Advanced • Before higher-risk releases
Review the whole
security boundary.
Plan threat models, automated security checks, limited AI tool access, and recovery exercises. Define evidence before calling a release ready.
Shared safety instructions included in every copied prompt
Inspect the current repository and its instructions first. Work only on this project in a local or test environment. Explain the risk and propose a small plan before editing. After I approve that plan, implement it and run focused checks. Do not deploy, change production data, spend money, or broaden account access without separate approval.
Prerequisites: Understand server routes, account permissions, automated tests, and deployment. A threat model maps what matters, who can reach it, and how it could be misused. For sensitive production systems, involve a qualified security reviewer.
1. Map assets and trust boundaries
List user data, credentials, administrative actions, and paid APIs. A trust boundary is where information crosses between different levels of trust, such as a browser calling your server. Use the OWASP Top 10 as an awareness checklist, not a compliance certificate.
Ask Claude to help
Map entry points, sensitive assets, trust boundaries, and abuse cases. Prioritize realistic risks with file references. Propose controls for the highest risks, including resource limits on expensive endpoints and protected audit logs. Identify assumptions and checks that require specialist review.Copy includes the shared safety instructions above.
Check the result: For every priority risk, identify the actual enforcement point and a test that would fail without it. Check that logs omit credentials and private content. Record accepted risks explicitly.
2. Protect the path from code to production
A dependency is code your project relies on. A CI pipeline runs checks on proposed changes. Updates and scanners help, but a passing scan does not prove the absence of vulnerabilities.
Ask Claude to help
Review dependencies, lockfiles, and CI permissions. Propose dependency and secret scanning using supported project tools. Keep untrusted pull requests away from production secrets and write-capable tokens. Add focused authorization regression checks. Do not auto-upgrade major dependencies or weaken a failing gate.Copy includes the shared safety instructions above.
Check the result: Verify checks ran on the exact proposed commit. Confirm a harmless failing test blocks the practice change. Review scanner findings and dependency compatibility instead of suppressing errors to obtain a green badge.
3. Constrain AI integrations
An agent can call tools and take actions. An MCP server exposes connected tools or data. Treat connector output as untrusted content and restrict actions independently of the prompt.
Ask Claude to help
Inventory AI tools and connectors. Propose narrow credentials, allowed destinations, validated tool arguments, and explicit approval for sensitive actions. Prevent retrieved text from authorizing tool calls. Review data sent to providers. Use dummy records for adversarial tests.Copy includes the shared safety instructions above.
Check the result: Verify denied actions are blocked outside the model. Check that logs and tool errors do not expose secrets. Review behavior when a tool times out or returns misleading instructions; do not test external systems without authorization.
4. Rehearse recovery
An incident plan should be usable when you are stressed. Identify who can revoke credentials, stop access, restore data, and communicate an outage. Practice a restore with fake data in isolation. Write down what was recovered, what was lost, and what was not tested.
Draft an incident and recovery checklist for this project. Include credential revocation, containment, backup restoration in an isolated environment, rollback limits, and evidence to preserve without exposing secrets. Do not perform destructive actions.Copy includes the shared safety instructions above.
Completion evidence: Record the commit reviewed, controls changed, passing and failing checks, remaining risks, and the person who will decide whether to release.
References
- Anthropic. (n.d.-ai). Security. Retrieved September 24, 2026, from https://code.claude.com/docs/en/security
- OWASP Foundation. (2025). OWASP Top 10:2025. https://top10.owasp.org/2025/
- OWASP Foundation. (n.d.-d). LLM Prompt Injection Prevention Cheat Sheet¶. Retrieved September 24, 2026, from https://cheatsheetseries.owasp.org/cheatsheets/LLM_Prompt_Injection_Prevention_Cheat_Sheet.html
- OWASP Foundation. (n.d.-e). Secrets Management Cheat Sheet¶. Retrieved September 24, 2026, from https://cheatsheetseries.owasp.org/cheatsheets/Secrets_Management_Cheat_Sheet.html
Was this chapter useful?
Report an errorVotes are shared only if you enable optional measurement in Privacy & Preferences.