Moiz Ali
Tetovo Available for projects
← BlogDec 1, 2026 · 7 min read
7 min read

Company Autopsy case study — Moiz Ali, AI agent engineer

Moiz Ali's case study of Company Autopsy: paste a company URL and get a one-page AI agent report in 10–16 seconds, on Gemini, Python, FastAPI and Next.js.

AI agentsCase study

I'm Moiz Ali. This is a case study of Company Autopsy, a live web app I built as a lead magnet for AI agent consulting. You paste a company's public website and get a one-page autopsy of where AI agents would save the team time, grounded only in what its own pages say. I designed, built and shipped it in a day in 2026. The stack is Gemini, Python, FastAPI, Next.js and TypeScript. It is in production.

You can run it live or open a sample report. The shorter run report is on the project page. You can also read About Moiz Ali.

The problem

Most companies know AI agents could help, but not where to start, and a first call usually spends half an hour just mapping what the business does. I wanted something a visitor can try in under a minute that does that mapping for their own company and ends with one concrete pilot worth talking about.

The interesting engineering problem is not only the report. The input is a URL a stranger typed in. An agent that fetches arbitrary URLs on your behalf is an attack surface, whether or not you were thinking of it that way when you started. The report also has to come back fast enough that someone will wait for it, and it has to keep working when a free-tier quota runs out.

The approach

The pipeline is short and visible. A URL is pasted, validated and rate-limited per IP. A safe fetch reads the website. Code extracts and clips the text, and fences it as untrusted data. Gemini runs the autopsy against a strict schema. Code then packs the report into a signed share link. There is no database.

On live runs, a finished report comes back in 10 to 16 seconds. It reads at most four pages per site and respects robots.txt. The report says what the company does, who it serves, three to five AI agent opportunities with effort and impact, the risks, and a first pilot to run. Those suggestions are meant to come from the site's own pages, not from a generic menu of AI ideas.

The fetch path is locked down because the input is someone else's URL. Only http and https on ports 80 and 443 are allowed. DNS is resolved once and every IP is checked, then the connection goes to that exact IP, so a DNS answer cannot swap in a private address later. TLS still verifies against the original hostname, so the certificate check doesn't get weaker. Every redirect is followed by hand, with a cap on hops, and each new location goes through the same validation from scratch. URLs with credentials embedded, IP literals, and internal-looking suffixes such as .local, .internal and .lan are rejected before a connection is even attempted. Bodies are read with a hard byte cap, and robots.txt is checked and honored for the tool's own user agent before any later page is fetched.

Website text is treated as untrusted data. It goes to the model inside a <website_data> block, with a system prompt that says to ignore any instructions in it. The answer must match a strict schema or it is rejected. Every field is then clipped to a sane maximum — a company name at 80 characters, a diagnosis at 110, and so on — before it is shown or put into a share link. None of that requires trusting the model to behave. It requires not needing to.

The product runs at $0 a month, on Gemini's free tier and free hosting. It is live on Vercel and Render, with 126 tests. Gemini Flash-Lite is tried first, then Flash, with a per-IP sliding window and a global daily cap on LLM calls. Those limits are held in memory: the service runs as a single small instance, so there is no shared store to keep consistent, and a restart just resets the counters, which only makes the limits briefly more generous, never less safe. When the daily cap is hit, visitors see a clearly labelled sample report instead of an error, so the product still demonstrates what it does with zero quota left for the day.

A collapsed field lets a visitor paste their own Gemini key. The key is sent once in a request header, checked against a basic format, used to build a client for that one request, and never stored or logged. There is a small utility whose job is scrubbing a secret out of any text before it could end up in a log line or an error response. Using your own key skips the shared daily cap. A bad or exhausted key comes back as a clear, specific error, not a silent fallback to the shared tier.

A finished report is serialized to compact JSON, compressed, base64url-encoded, and signed with a truncated HMAC-SHA256. The whole thing lives inside the share link itself. Decoding a link re-verifies that signature with a constant-time comparison before trusting any of its contents, so a link can't be hand-edited to put different words in someone's report, and there is nothing to store or leak. Each shared report gets its own preview image.

Progress streams live. The page shows each step, reading pages and analysing, as it happens, so a cold start or a slow site doesn't look like a hang.

I wrote a longer account of the safety work in what building Company Autopsy taught me, and the same free-tier discipline in building AI agents on a $0 budget. GeoLumen uses the same hardened-fetch instinct when it checks other people's robots.txt files.

Results

These are the numbers I will stand behind, from live runs on real company sites:

  • 10 to 16 seconds from a pasted URL to a finished report.
  • At most four pages read per site, with robots.txt respected.
  • No database: every share link is a signed URL.
  • $0 a month to run, on Gemini's free tier and free hosting.

I have not yet measured how often the suggested pilot matches what a person would pick after a real call. I am not going to fill that gap with a guess.

What broke

The SSRF guard blocked the sandbox it was tested in. The test machine's DNS resolves every host to a reserved range, which the guard correctly refused. The fix was a development-only allow list for specific CIDR ranges, read from an environment variable that production never sets. It is tempting to disable the check while testing, and that is the kind of thing that accidentally ships. Keeping the allow list opt-in and dev-only closes that gap.

The share preview also showed a missing-glyph box. The image renderer's font had no "✚", so the card logo rendered as a blank box until I swapped in a plain "+". A missing glyph is a five-minute fix. A DNS rebinding gap is not.

What I'd do next

The next work is already written down on the project page, and I have not done it yet. I want a measurement of how often the suggested pilot matches what a person would pick after a real call, and a shared rate-limit store so the limits hold across more than one server. Until those exist, the honest status is that Company Autopsy can fetch a public site safely, write a grounded report, and share it as a signed URL, on a free tier that fails as a labelled sample instead of a broken page.

Try it, or get in touch

You can run Company Autopsy live or open a sample report. The shorter walkthrough of the system is on the Company Autopsy project page.

If you have work that should run itself, or you are hiring for a full-time remote role in Europe, use the contact form or download my resume. You can also read About Moiz Ali.

About Moiz Ali, AI agent engineer in Tetovo.