AI agent security review workflow
Use an AI coding agent to review auth, authorization, inputs, secrets and payment changes before shipping.

Put it into practice
What you will produce
A threat-focused finding list covering authorization, validation, tenant scope, secrets, network and error exposure as relevant.
- 01
Name attacker and boundary
State who controls the input, which trust boundary it crosses, and the asset at risk.
Expected result: The review has a concrete threat model.
- 02
Trace untrusted input
Follow the value through parsing, validation, authorization, tenant scope, and the sensitive operation.
Expected result: The path shows where controls apply or are missing.
- 03
Test a plausible abuse case
Use safe fixtures for a relevant bypass such as cross-tenant access or malformed input; never use live credentials.
Expected result: A reproducible test is tied to the threat.
- 04
Write evidence-backed findings
Record attacker capability, reachable code, impact, reference, and remediation; separate unverified concerns.
Expected result: An owner can reproduce and prioritize each finding.
Acceptance checks
- The review has a concrete threat model.
- A reproducible test is tied to the threat.
- An owner can reproduce and prioritize each finding.
Limits and trade-offs
Automated review can miss system-level trust boundaries. Do not paste live secrets or sensitive production data into the agent context.
Official sources
Review security with agents
Related guides
CLAUDE.md: A Guide for Every Developer
One markdown file that makes AI coding assistants actually understand your codebase. Here's what to put in it.
There's a reason Claude Code writes great code in some projects and generic boilerplate in others. It's not the model. It's CLAUDE.md . It is one part of my Claude Code workflow: project conventions reduce guesswork, but they do not guarantee a speedup or remove the need to review the change. What it is CLAUDE.md is a plain markdown file that Claude Code reads at the start of every session. Think of it as the onboarding doc you'd give a senior contractor on day one: stack, conventions, rules, context. Without it, Claude infers patterns from what it sees in the codebase. Sometimes it infers correctly. Often it doesn't especially for implicit conventions your team just "knows". A CLAUDE.md makes your rules available without repeating them, but does not guarantee compliance: review the diff and run the checks. What to put in it 1. Stack and versions Simple but important. These…
Read the guide5 Claude Code Hooks I Use Daily
Claude Code hooks run shell commands on session start, file writes, and tool calls. Here are the 5 I use daily and how to configure them.
Most people discover Claude Code for the AI. They miss the hooks. Hooks are shell commands that execute automatically when something happens in your Claude Code session: a session starts, a tool runs, Claude stops. You define them in .claude/settings.json . They run silently in the background. Here are the 5 I use every day. What hooks look like The available events: SessionStart , UserPromptSubmit , PreToolUse , PostToolUse , Stop . Hook 1 Auto inject date on every prompt Event : UserPromptSubmit Claude doesn't have real time awareness. Every prompt gets the current date injected automatically. Useful for anything time sensitive: changelogs, deadlines, scheduling logic. Hook 2 Push notification when Claude stops Event : Stop Long tasks (refactors, test runs, analysis) can take 2–5 minutes. Without a notification I'd either stare at the screen or miss the result. This fires whenever Claude finishes a task, whether it succeeded or…
Read the guideClaude Code Subagents: Parallel Agents
Learn when Claude Code subagents help, how to split parallel work, and how to configure a focused custom subagent without creating conflicts.
Subagents are useful when a task can be split cleanly: one agent searches the authentication code, another traces the database path, and the main conversation compares what they found. They add little to "read this file" or to work where every step depends on the same context. Short version: delegate independent research or a separate review when the results are worth the extra context and usage. Give each agent a narrow scope, the files or area to inspect, and a specific report format. Keep dependent work in the main conversation. Claude Code agents vs subagents Claude Code's documentation calls delegated workers subagents and uses Agent for the tool that starts them. When people search for Claude Code agents in this context, they usually mean subagents: workers that handle a delegated task in their own context and return a result to the main conversation. Claude Code's subagent documentation uses this terminology.…
Read the guide