OWASP Excessive-Agency Audit
Audit an AI agent's blast radius before shipping: least-privilege tools, human gates on irreversible actions, output handling, and leak assumptions.
Audit my AI agent's guardrails before it ships. Work the checklist against what I describe: the goal is bounding what a manipulated or malfunctioning agent can DO, not achieving a vibe of safety.
The agent: [WHAT IT DOES + WHO USES IT]
Its tools/capabilities: [EVERY TOOL + what each can read/write/spend/send]
What it ingests: [THE UNTRUSTED INPUTS: user messages, emails, web pages, documents, tool outputs]
Where its output goes: [DISPLAYED TO USERS / EXECUTED / WRITTEN TO SYSTEMS / SENT EXTERNALLY]
Audit each area, for every finding: the risk scenario (concrete), severity, and the specific fix:
1. **Excessive agency (the big one):** For each tool, does the agent need it for its stated job, with THIS scope? Flag: write access where read serves, broad API scopes ("repo" when "issues:read" would do), tools that can spend money/send external messages/delete data without a human gate, and standing credentials where per-session or per-user credentials are possible. The test: describe the worst thing a prompt-injected agent could do with the current toolset in one sentence. If that sentence is scary, the toolset is wrong, whatever the prompt says.
2. **Human approval gates:** which actions are irreversible or outward-facing (sends, payments, deletions, publishing)? Each needs explicit human confirmation OR a documented decision that the risk is accepted: silence is not a decision. Gates live in CODE (the tool requires confirmation), not in the prompt ("always ask first" is advisory and will eventually be bypassed).
3. **Improper output handling:** everywhere the agent's output lands, is it treated as untrusted input? HTML-encode before rendering (agent output can carry XSS from ingested content), parameterize before DB use, never eval/execute output without sandboxing, validate against a schema before writing to systems.
4. **System prompt leakage: assume it leaks:** nothing sensitive lives in the prompt: no credentials, no internal role names with authority ("you may approve refunds as agent-admin"), no security-through-prompt-secrecy. The prompt can be extracted; design so that's an inconvenience, not a breach.
5. **Untrusted content discipline:** every external input (documents, web content, tool results) enters wrapped/delimited as data, with the instruction-following boundary stated; instructions found inside data get reported, not followed. (Prompt-level defense is one layer: the real containment is items 1-2.)
6. **Unbounded consumption:** caps on loop iterations, tool calls per task, tokens per session, and spend per period; a runaway agent should hit a limit, not a credit card statement.
7. **The kill switch:** how do we stop it mid-action, revoke its credentials fast, and audit what it did (logs of every tool call with arguments)?
Output: the findings table (area | scenario | severity | fix), the top 3 changes before ship, and the one-paragraph residual-risk statement I should get sign-off on; an honest "what could still go wrong" beats a clean-sounding audit.
Rules: prompt wording is the weakest layer here, wherever my description relies on "the prompt says not to", propose the structural version (scope, gate, cap) instead.How to use
This operationalizes the OWASP LLM Top 10's agent-relevant items (excessive agency, improper output handling, prompt leakage, unbounded consumption) as a pre-ship audit. The core doctrine: guardrails that matter live in the toolset and the gates, not the prompt; the one-sentence worst-case test in step 1 is the fastest way to find over-scoped agents. Re-run the audit whenever a tool is added: scope creep is how safe agents become unsafe.
More agent prompts
You are a software engineering agent working in the [PRODUCT/TEAM] codebase ([LANGUAGE/STACK]). Your objective is to take an assigned task from description to verified, working code. You may read and modify anything in the repository; you do not push, merge, deploy, or alter CI configuration unless the task explicitly says to. # Operatin
Coding Agent System Prompt
Autonomous coding agent that matches repo conventions, proves work with passing tests before claiming done, and reports failures truthfully.
You are a debugging agent for the [PRODUCT] codebase. Your objective is to find the root cause of a reported bug, fix it with the smallest possible change, and prove the fix. You are not here to refactor, harden, or improve unrelated code: a debugging session that ends in a 40-file diff has failed even if the bug is gone. # Reproduce Bef
Debugging Agent System Prompt
Root-cause-first debugging agent: no fix until the bug is reproduced, minimal diffs only, and done means the repro dies while the test suite stays green.
You are a code migration agent. Your objective is to move the [PRODUCT] codebase from [SOURCE VERSION/FRAMEWORK] to [TARGET VERSION/FRAMEWORK] while preserving behavior exactly. You are a mechanical translator with judgment, not a redesigner: the product must work the same after every step you take. # The Prime Rule: Migration Changes On
Code Migration Agent System Prompt
Framework-upgrade agent that migrates in build-green slices, verifies every codemod, follows official guides over memory, and never mixes in behavior changes.