zero-trust
Skill17 starsChanged 56 days agoMITView on GitHub
Distinguished-engineer playbook for Zero Trust design reviews across identity, network, data, workload, and AI/agent systems. Principles-first, opinionated, threat-model-driven. Use when designing or reviewing auth flows, tool scopes for agents, MCP servers, RAG pipelines, egress policies, secret handling, HITL gates, or any change that crosses a trust boundary.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- alizafarbati/opencode-agents-mcptheir own version, first seen Sep 8, 2026
- anurag-azure/skillstheir own version, first seen Jun 27, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- alizafarbati/opencode-agents-mcp★ 1same name
- anurag-azure/skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository53 other files it gives its agents.
- agents-sdkSkill
- agent-workflowSkill
- api-designSkill
- aws-iamSkill
- bash-shell-scriptingSkill
- cicd-github-actionsSkill
- cloudflare-email-serviceSkill
- cloudflareSkill
- cloudflare-waf-authorSkill
- cloudflare-workers-authorSkill
- cloud-platformsSkill
- codebase-security-auditSkill
- containers-orchestrationSkill
- core-engineeringSkill
- database-postgresqlSkill
- databricksSkill
- data-engineeringSkill
- distributed-transactionsSkill
- documentation-standardsSkill
- domain-driven-designSkill
- durable-objectsSkill
- frontend-engineeringSkill
- git-workflowSkill
- go-rust-systemsSkill
- iam-security-advisorSkill
- independent-verificationSkill
- infrastructure-iacSkill
- kubernetes-containersSkill
- kubernetes-operator-developmentSkill
- mcp-developmentSkill
- memory-architectureSkill
- multi-perspective-reviewSkill
- networking-transportSkill
- observabilitySkill
- oktaSkill
- pdf-exportSkill
- python-developmentSkill
- reactflow-architecture-diagramsSkill
- sandbox-sdkSkill
- scripting-automationSkill
- security-testingSkill
- service-resilienceSkill
- single-file-dashboardSkill
- skills-compositionSkill
- skills-continuous-improvementSkill
- snowflakeSkill
- system-designSkill
- typescript-javascriptSkill
- web-perfSkill
- web-research-kb-refreshSkill
- workers-best-practicesSkill
- workload-identitySkill
- wranglerSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 13 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈13
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 16
Use when the user:
- Distinctive: line 25
Do *not* use this skill for:
- Distinctive: line 35
Never trust, always verify.
- Distinctive: line 41
When you cannot ground a design decision in one of these, stop and ask why.
- Very specific: line 53
Scope each tool's identity: Prefer narrow roles: order_service_reader_for_tenant_X beats order_service_admin.
- Distinctive: line 56
Design the HITL gate: Every destructive/irreversible action has: preview, timeout, signed receipt, audit.
- Distinctive: line 81
Add audit emission: Every tool call emits a structured event to an append-only store.
- Distinctive: line 120
Enumerate destructive tools: Delete, deploy, publish, pay, send, grant, message, push, commit.
- Distinctive: line 126
Audit approvals: Every request, approval, denial, timeout logged to the append-only store.
- Distinctive: line 158
Use after proposing a Zero Trust architecture and before treating the design as ready.
- Distinctive: line 163
Run the reality check: Test scale, quotas, latency, availability, operational ownership, cost, control-plane dependency, and degraded …
- Distinctive: line 168
Revise and re-run: Update the architecture, then repeat the reality and abuse checks until blockers are resolved or explicitly accepted.
- Very specific: line 172
Follow the adversarial architecture review reference (${HANDBOOK_ROOT}/skills/zero-trust/references/adversarial-architecture-review.md).
- Distinctive: line 178
When reviewing, structure findings like this:
- Distinctive: line 195
No vague "consider adding security".
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Zero Trust - Distinguished Engineer Playbook
Voice: this skill speaks as a Distinguished Engineer in design review. Opinionated. Principles over products. Threat models before controls. Reversibility over cleverness. Will say "no" with reasons.
Companion rule: 316-zero-trust.mdc (always-on). This skill turns those principles into reusable workflows.
When to invoke this skill
Use when the user:
- Asks for Zero Trust review of an architecture, a PR, or a design doc
- Is designing or hardening an AI agent, MCP server, or RAG pipeline
- Needs a tool allow-list, capability-token design, or HITL gate
- Wants a threat model for prompt injection, secret leakage, or tool abuse
- Is arguing whether something is "Zero Trust" (it usually isn't)
- Needs cost / rate / quota controls treated as security
Do not use this skill for:
- OWASP Top 10 application bugs - use
security-testingskill - IAM protocol reference (OIDC mechanics, SAML bindings) - use
315-iam.mdc - Vendor-specific IAM (AWS, Azure, GCP) - use
412-aws-iam.mdcand cloud rules
The Five Golden Rules (anchor for every review)
- Never trust, always verify.
- Least privilege, per call, per session.
- Assume breach.
- Deterministic guardrails before LLM decisions.
- Auditability for every trust decision.
When you cannot ground a design decision in one of these, stop and ask why.
Workflow 1 - Design an Agent Under Zero Trust
Produce a Zero Trust design doc for a new AI agent or MCP-backed feature.
Steps
- State the purpose and blast radius. What can this agent change, send, buy, delete, or disclose? Write the worst-case outcome in one sentence.
- Enumerate tools. Each tool gets: name, inputs, outputs, identity it runs as, resources it touches, and reversibility (reversible / destructive / irreversible).
- Scope each tool's identity. Prefer narrow roles:
order_service_reader_for_tenant_Xbeatsorder_service_admin. - Replace credentials with capability tokens. Tools accept short-lived tokens bound to
(caller, resource, action, time). Never raw secrets. - Classify data flows. For each tool: what data goes out (to model / external API), what data comes back. Mark PII/PCI/PHI fields.
- Design the HITL gate. Every destructive/irreversible action has: preview, timeout, signed receipt, audit.
- Define per-tenant isolation. Prompts, retrieval indexes, memory - all tenant-scoped. Prove it with a test.
- Set rate and cost caps. Per session, per user, per tenant. Hard stops, not warnings.
- Specify audit events. For each tool invocation: who, when, inputs (hashed/redacted), policy version, decision, result.
- Write the prompt-injection threat model. Where does untrusted text enter? What's the worst thing a crafted input could do? What's the mitigation?
Deliverable: design doc with the sections above + a Do/Don't table.
See references/agent-design.md for templates.
Workflow 2 - Harden an Existing MCP Server
Take an MCP server from "it works" to "it's reviewed".
Steps
- Inventory tools. List every tool with signature and description. If you can't explain a tool in one sentence, it's too broad - split it.
- Flag overly broad tools. Anything named
run_*,execute_*,query_*,fetch_url,write_filewithout a path allow-list,send_*without a recipient allow-list. Replace with narrower tools. - Require identity on every call. The MCP server must verify who is calling (OIDC, mTLS, or signed caller token) and refuse to act without identity.
- Scope tokens to the caller. Capability tokens minted per session, per caller, per resource. No shared master token.
- Add schema validation on inputs. Reject out-of-schema inputs with structured errors; never pass unvalidated input to downstream systems.
- Sanitize outputs. Strip secrets from tool outputs before returning. The model will log what it sees.
- Add an HITL wrapper for destructive tools. The MCP server returns a "pending approval" result; a separate surface collects the signed approval; the tool executes only on receipt.
- Add audit emission. Every tool call emits a structured event to an append-only store.
- Add rate + cost limits. Per caller, per tool. Hard stops.
- Write a prompt-injection test suite. Adversarial inputs for each tool; assert the server refuses or narrows the action.
Deliverable: PR with narrowed tools, capability-token auth, schema validation, audit emission, HITL wrapper, and tests.
See references/mcp-hardening.md for checklists and patterns.
Workflow 3 - Review an AI Feature for Injection and Secret Leak
Fast review pass. Use on any PR that adds LLM calls or tool invocations.
Steps
- Find every string the model sees. System prompt, user input, tool outputs, RAG chunks, file contents, URL fetches. Each is an injection vector.
- Find every string the model emits that triggers a side effect. Each is an output-injection risk.
- Check separation of instructions and data. System prompt and trusted tool results vs user/tool content - distinct channels where the framework supports it.
- Check schema enforcement. Structured output? Schema validated before use? Policy check before side effect?
- Check secret flow. Does the model see any secret value? If yes - stop. Route through a tool.
- Check logging. Are request/response bodies redacted? Are tool outputs scrubbed before logs?
- Check RAG provenance. Is each chunk tagged with tenant/source/classification? Is retrieval filtered at query time? Is classification checked before rendering?
- Check HITL for destructive actions. Does "the model said the user approved" short-circuit a gate? (Find the gate code; read it; make sure approval is a signed receipt, not a string.)
- Check tenant isolation in memory and retrieval.
- Check cost and rate caps.
Deliverable: review comments with principle references (golden rules 1-5) and concrete fixes.
See references/injection-threat-model.md for a reusable threat model.
Workflow 4 - Add HITL Gates to Destructive Tools
Retrofit HITL onto an agent or tool layer that doesn't have one.
Steps
- Enumerate destructive tools. Delete, deploy, publish, pay, send, grant, message, push, commit.
- Define approval payload.
{action, target, caller, preview, diff, requested_at, expires_at, request_hash}. - Build the gate surface. UI (web, chat, email) that shows the payload and collects approval.
- Sign approvals. Gate returns
{request_hash, approver_id, approved_at, signature}. Signature uses a key the tool server can verify. - Require signed receipts on tool invocation. Tools reject calls without a valid, unexpired, matching receipt.
- Time-bound and single-use. Receipts expire; receipts are single-use (tracked in a ledger).
- Audit approvals. Every request, approval, denial, timeout logged to the append-only store.
- Test bypass attempts. Can the model fake approval? Reuse a receipt? Race a replay? Expire-but-succeed?
Deliverable: gate service, receipt format, verification middleware, audit events, bypass test suite.
See references/hitl-gates.md for sequence diagrams and receipt format.
Workflow 5 - Produce a Zero Trust Threat Model + Reviewer Checklist
Output a short threat model for a feature crossing a trust boundary.
Steps
- Describe the feature in one paragraph. Scope, principals, data, actions.
- Draw the trust boundaries. Mermaid diagram: principal -> verify -> authorize -> resource + audit.
- Enumerate the principals and their identities (human, service, agent, model).
- Enumerate the assets and classifications.
- Enumerate the actions and reversibility.
- Enumerate threats (STRIDE + AI-specific: prompt injection, secret leak, tool abuse, cost abuse, cross-tenant leak).
- For each threat: control, owner, test.
- Emit the reviewer checklist from
316-zero-trust.mdctailored to this feature.
Deliverable: one-page threat model + checklist attached to the PR or design doc.
See references/threat-model-template.md.
Workflow 6 - Adversarially Validate an Architecture Pattern
Use after proposing a Zero Trust architecture and before treating the design as ready.
Steps
- Restate the claimed guarantees. Name the protected assets, principals, enforcement points, failure domains, and assumptions.
- Run the reality check. Test scale, quotas, latency, availability, operational ownership, cost, control-plane dependency, and degraded behavior.
- Challenge necessity. Identify a simpler design and state when the proposed pattern should not be used.
- Simulate abuse defensively. For each credible path, record preconditions, affected control, blast radius, persistence, and observable evidence. Include identity theft, replay, confused deputy, privilege escalation, lateral movement, data exfiltration, agent tool abuse, and control-plane compromise where applicable.
- Switch to defender analysis. Map each path to prevention, detection, containment, recovery, owner, and a deterministic test.
- Test chained failure. Assume one preventive control fails; verify another distinct control detects or contains the attack rather than repeating the same decision.
- Revise and re-run. Update the architecture, then repeat the reality and abuse checks until blockers are resolved or explicitly accepted.
Deliverable: adversarial architecture review with prioritized findings, simpler alternative, when-not-to-use criteria, control/test mapping, and unresolved risk owners.
Follow the adversarial architecture review reference (${HANDBOOK_ROOT}/skills/zero-trust/references/adversarial-architecture-review.md).
Review Output Format
When reviewing, structure findings like this:
[BLOCKER] <one-line summary>
Principle: <which golden rule>
Evidence: <file:line or config snippet>
Why it matters: <blast radius / attack path>
Fix: <specific, actionable>
[IMPORTANT] <...>
[SUGGESTION] <...>- BLOCKER = violates a golden rule or introduces unacceptable blast radius
- IMPORTANT = serious weakening of Zero Trust posture
- SUGGESTION = tightens posture; not required to merge
No vague "consider adding security". Be specific. Show the code.
Common Failure Modes (call these out)
- "Zero Trust" used as marketing for what is still perimeter security
- Long-lived credentials because "rotation is a pain"
- Agent with admin role "temporarily"
- Model as policy engine ("the LLM will decide what's safe")
- RAG with a shared index across tenants
- HITL gate where the model synthesizes approval
- Audit logs in mutable app log store
- Rotation-as-control instead of short-lived credentials
- "Internal" APIs trusted because VPC
- Security groups used as the authorization layer
Each of these is in 316-zero-trust.mdc with principle and fix.
References
- references/agent-design.md - Agent design template with tool inventory, HITL, audit plan
- references/mcp-hardening.md - MCP server hardening checklist and patterns
- references/injection-threat-model.md - Prompt injection threat model and defenses
- references/hitl-gates.md - HITL gate design, receipt format, verification
- references/threat-model-template.md - One-page Zero Trust threat model
- adversarial architecture review (
${HANDBOOK_ROOT}/skills/zero-trust/references/adversarial-architecture-review.md) - Reality check, defensive abuse simulation, and design iteration
Related
- Rule:
316-zero-trust.mdc(the always-on companion) - Rule:
310-security.mdc(OWASP) - Rule:
315-iam.mdc(IAM protocols) - Rule:
412-aws-iam.mdc(AWS IAM specifics) - Rule:
500-ai-ml.mdc,510-mcp-servers.mdc(AI and MCP patterns) - Rule:
020-agent-audit.mdc(local agent guardrails) - Skill:
security-testing(OWASP checklist + testing) - Skill:
mcp-development(building MCP servers)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

