Use case
Agent-driven code review. Clone a repo, lint it, let the agent propose fixes via theapply_patch tool, summarize findings. The
review never runs on your laptop — the clone, the linter, and the
diff all live in a throwaway VM.
Template
ai-agent — large template with common agent-framework deps
pre-installed (langchain, crewai, autogen, plus git/python
tooling). Good choice when the agent needs to run Python code
with a rich set of imports without a pip install delay.
Run it
Security policy
README.md could
try to override the reviewer’s system prompt. The scanner runs on
the request body before the LLM call — the agent code doesn’t have
to implement any defense itself.
Env isolation in practice
printenv rather than having them in
the system prompt. This means:
- No secret values in model traces or guardrails logs.
- Rotating a value doesn’t need a prompt change.
- Per-reviewer customization (depth, id) stays structured.
What the agent does
printenv REVIEWER_ID REVIEW_DEPTH TARGET_REPOgit clone --depth 1 $TARGET_REPO /workspace/repopip install -q ruffruff check /workspace/reporuff check --fix /workspace/repo && git -C /workspace/repo diff- Write
/workspace/review.mdwith sections for metadata, findings, auto-fixes, and remaining action items.
Expected output
Full source
Seecookbook/openai_agents_code_reviewer.py in the repo.