All case studies

Security and AI

Sandboxing an AI security reviewer before it reviews anything

We piloted AI agents that look for vulnerabilities in pull requests. Before trusting them with real code, I tested whether their own permission rules actually held. Some didn’t.

Stack
GitHub Actions reusable workflows, Docker, an agentic coding CLI running Claude models, S3
My role
Permission testing, sandbox design and the pipeline
Outcome
A reusable PR security check that runs in an isolated, pinned runtime, with an opt-in gate that can block merges.

The design

The check uses two agents. A hunter reads the diff and the code around it, then proposes findings. A validator tries to confirm each one, and builds a proof of concept for any it confirms. The report goes on the pull request and is archived in S3. Teams choose whether to let it block merges.

The threat model problem

A security reviewer reads untrusted code, including comments and strings an attacker controls. If a prompt injection takes over an agent that has write access, it could edit the workflow’s own scripts and report the pull request as clean. That makes the agent’s tool permissions the security boundary. So I tested them before relying on them.

What testing showed

So the boundary moved to the container

Config rules are useful, but they aren’t enforcement. The workflow now runs each agent in a throwaway container:

The report also includes the hunter’s leads that the validator couldn’t confirm. People can see what was considered and dropped, not only what was confirmed.

Proving it end to end

Before marking it ready, I ran the full pipeline on a small repo with a planted bug. The hunter found it, the validator confirmed it, the proof of concept worked, and the gate failed the check, as it should. It’s piloting on one repository. Other repositories can call it with one line.

What the sandbox doesn’t cover yet

What I took from it

  • Test a guardrail before relying on it. Documentation tells you what was intended, not what happens.
  • For agents that read untrusted input, enforce limits at the OS and container layer, not in the prompt or config.
  • Pin everything an automated security check runs. Otherwise the check is itself part of your attack surface.