Building a Custom AI Agent

A practical walkthrough for policy teams

Andrew Gruen, PhD
Senior Fellow, Future of Privacy Forum
CEO, Working Paper

There are two agents in this talk

  1. The one that built the thing (hi Claude/Codex 👋)
  2. The one that IS the thing (you're going to make one!)

(This is confusing. I didn't name them. Welcome to AI.)

The problem

Every month, somebody at FPF reads everything that went wrong with AI and asks one question about each item:

Was that a privacy thing?

What we wanted

A table. One row per incident.

Date, incident number, headline, what happened, risk category.

A human edits it. The tool never sends it.

Basically, we wanted this:

Date Incident Number Headline What Happened AI Governance Risk Categories
8/15/26 1643 Grok Allegedly Used to Generate Explicit Images of Woman From Childhood Photo A Wyoming woman alleges her stepfather used xAI's Grok to generate thousands of sexually explicit images from a childhood photograph, in federal court filings. Source: washingtonpost.com Nonconsensual Deepfake Generation: Image generator lacked safeguards blocking sexualized synthesis from an uploaded photo of an identifiable minor.
8/19/26 1660 Deepfake Impersonating Miami Immigration Attorney Defrauded Bronx Resident Scammers allegedly used AI-generated videos impersonating an immigration attorney to solicit a citizenship-seeker, who sent money and handed over Social Security and residency documents before discovering the fraud. Source: abc7ny.com, miamiherald.com, cbsnews.com Deepfake Impersonation Fraud: No likeness-verification or provenance signals let a fabricated professional identity harvest sensitive PII.
8/5/26 1649 Meta AI Model Reportedly Exploited Third-Party Service in Misconfigured Test During a Meta cybersecurity evaluation, one of its AI models reportedly gained unintended internet access after a misconfiguration and exploited a vulnerability in a real third-party service. Source: reuters.com, bleepingcomputer.com, washingtonpost.com Autonomous Agent Containment Failure: Evaluation-environment misconfiguration let an AI agent reach and attack live external systems unsupervised.
8/17/26 1665 AI-Generated Fake Interview Misused Australian Broadcaster's Likeness for Crypto Scam An online article reportedly used AI imagery to falsely depict an ABC finance presenter interviewing Australia's central bank governor to promote an unlicensed crypto platform, which regulators flagged as scam. Source: smh.com.au, abc.net.au, asic.gov.au Deepfake Impersonation Fraud: Absent likeness protections and content authentication enabled misappropriation of public figures for investment fraud.
8/18/26 1663 AI-Assisted Scam Impersonating NPR Host Defrauded Comedy Writer A writer reportedly received personalized messages impersonating NPR's Terry Gross inviting him onto a fake show, and sent money before learning the interview was fraudulent. Source: whyy.org, hollywoodreporter.com Impersonation & Targeted Profiling: Highly tailored lures suggest harvested personal data fed AI-composed impersonation with no sender verification.
8/18/26 1664 AI-Assisted Podcast Scam Led to Broadway Host's Facebook Takeover A SiriusXM host reportedly received a fake podcast invitation impersonating a comedian and lost access to his Facebook page after scammers guided him through permission changes. Source: hollywoodreporter.com Account Takeover via Social Engineering: AI-composed lures plus permission-granting manipulation bypassed account-access safeguards and controls.
8/14/26 1639 Turkish National Posted AI-Generated Image With Eric Trump to Bolster Persona A Turkish national reportedly posted a purportedly AI-generated LinkedIn image depicting himself with Eric Trump while promoting a Trump-branded hotel and portraying close political ties. Source: tr.euronews.com Likeness Misappropriation: Unauthorized synthetic use of a public figure's likeness lacked platform authenticity checks.

The ingredient

The AI Incident Database.1

Community-maintained. Weekly snapshot. About 1,600 incidents and counting.

Each one already comes with a pile of news reports attached.

  1. https://incidentdatabase.ai ↩︎

Is this an agent problem?

  1. It recurs on a schedule
  2. The inputs are machine-readable
  3. The output has a fixed shape
  4. A human was going to review it anyway

    Obviously.

You might ask

Does a policy person need to know how to build software?

No.

That's the point.

This is a cooking show

Here's one I made earlier.

The recipe cards are prompts. You get to see each card, then the dish.

Then you cook.

Recipe card 1: the plan

ok so: every month someone at FPF reads everything that went wrong with AI and pulls out the privacy incidents for a digest. I want a small tool that does the reading and drafting, and a human does the editing.

Don't write code yet. Write docs/BUILD_PLAN.md. Lock the decisions: one container, one database file, one source to start (the AI Incident Database), the model drafts and never sends. Break it into phases I can build one at a time.

What came out

146 lines. A section called "Decisions locked." Eight phases.

Written before a single line of code.1

  1. https://github.com/agruen/ai-privacy-newsletter/blob/main/docs/BUILD_PLAN.md ↩︎

Sources: AIID only in v1, behind a pluggable SourceConnector interface so Federal Register / DPA feeds / arXiv / RSS can be added later.

Each source is a thing that breaks when nobody is watching. So: one first.

Recipe card 2: the build

Build Phase 0 from docs/BUILD_PLAN.md. Nothing from later phases. Tests must pass. Commit with a message that says what you did, then stop and show me.

Then I said "next phase" seven more times.

Eight commits, one afternoon

A commit is the old-school 💾 button + a version number MyFile-v2.doc

Phase 0 through Phase 7. All dated June 19.

I had lunch.

Recipe card 3: the inspection

I'm about to put this on the internet. Review it as a hostile security auditor. Rank what you find, fix the blockers, and tell me what you couldn't fix.

It found a forgeable login key and a container running as root. It fixed both.

Do this before you deploy anything. Every time. Particularly if you're putting it on the Internet. If it's just on your machine... less of a worry!

What came out of the oven

1,656 incidents ingested

One issue: seven rows

Thirteen cents

The part they edit out on TV

Burnt batch 1: the free filter

The plan said: don't pay a model to classify. Use the database's own "Privacy & Security" tag.

The tag flagged almost nothing.

The privacy tag from the database is catching almost nothing, maybe 3 of 30 incidents a month. Have the model screen every incident for a privacy angle instead. Keep the tag as a hint. Store the judgments so I'm not billed twice for the same month.

Burnt batch 2: the links

The model writes very convincing URLs. They don't resolve.

The model keeps inventing links that don't resolve. Change the design so it never writes a URL. It fills in four text cells per row; the date, the incident number and every link get joined from our own database when the page renders.

The fix was not a better prompt. It was taking the job away.

The bill

Thirteen cents per issue

Under $25 a month for hosting

A $100 monthly cap, enforced by the code, not by me

The coffee cost more.

Recipe card 4: the runbook

Write docs/RUNBOOK.md for the person who will run this every month. Assume they have never seen the code and never will. Start with the monthly review, then what to do when the source is down.

Where the human stays

  1. Read the member-mention banner first
  2. Edit the four cells the model wrote; the rest is our data
  3. Drop weak rows, pull stronger ones from the pool
  4. Approve. That locks it.
  5. Export, and paste into the real sending tool

Disclose twice

In the commit log, for whoever maintains it

In the footer, for whoever reads it

Add a one-line disclosure at the end of every export saying the table was drafted with an AI model from AI Incident Database records and reviewed by FPF staff.

The checklist ✅

  1. Recurring task, machine-readable inputs, fixed output shape. If not, write a checklist instead.
  2. Plan first. Lock the decisions. Write down what you are NOT building yet.
  3. One source. Add the second when the first is boring.
  4. Check the filter against a real month before you trust it.
  5. Never ask the model for a fact you already have in a database.
  6. Hard cost cap in code. Buttons that refuse to bill twice.
  7. Hostile review before it touches the internet.
  8. Decide where the human sits and make the tool stop there.
  9. Disclose twice.


    (Hint: This is the slide to screenshot.)

Now you cook

A classic car auction listing.

It says it has 142 photos. Seven are in the page.

Your agent's first job is to notice.

Questions?

Thank you!

My Inbox is Yours 📨

ag@workingpaper.co

workingpaper.co/presentations/build-your-own-agent