ericrisco/rsc-harness / skills/agent-safety
agent-safety
FlaggedUse when bounding an LLM agent that already runs — scoping its task domain, gating tools to least privilege, defending against prompt injection in untrusted web/email/RAG text, requiring human approval on irreversible actions, capping runtime and cost, or triaging what it already did. NOT building the loop, tools, or RAG (that is `building-agents`).
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 10.3 KB |
| evals/README.md | markdown | 910 B |
| evals/cases.yaml | config | 3.2 KB |
| references/threat-model.md | markdown | 4.0 KB |
references/threat-model.md
View on GitHub# Threat model: OWASP Agentic Top 10 (2026) → controls
Mapping of the named agentic risks to the control in `../SKILL.md` that mitigates each.
Sources: OWASP Gen AI Security Project, "OWASP Top 10 for Agentic Applications for 2026"
(genai.owasp.org); OWASP Top 10 for LLM Applications v2025; OWASP AI Agent Security Cheat
Sheet (cheatsheetseries.owasp.org). All accessed 2026-06-02.
| Agentic risk | What it is | Control in this skill |
| ---------------------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------- |
| Memory poisoning (T1) | Contamination persists across sessions, re-attacking every future run | Memory hygiene: validate before store, isolate, expire |
| Tool misuse & exploitation | Abuse via unsafe composition / recursion / excessive calls *with* valid perms | Tool gating + runtime kill-switches (rate/loop caps) |
| Privilege compromise | Broad or stolen creds let the loop act beyond its task | Task-scoped short-lived tokens; least agency |
| Indirect prompt injection (LLM01) | Untrusted content carries instructions the model executes | Trust-boundary table; segregate data from instructions |
| Excessive agency | Acting without check-back on irreversible/external actions | HITL by risk class; deny-by-default scope |
| Data exfiltration | Stolen data leaves via tool output / outbound calls | Output schema validation; exfil-shape detection |
The OWASP framing of root causes — excessive **functionality**, **permissions**,
**autonomy** — maps one-to-one onto the three excesses in the SKILL body. Cutting all three
is the deny-by-default + least-agency posture.
## Pre-ship guardrail checklist
Before an autonomous loop reaches production, confirm:
- [ ] Allowed task domain is declared in the system prompt as a hard boundary.
- [ ] Tools are deny-by-default; each enabled tool has a written task justification.
- [ ] Every tool has a profile (read / write / exec / send) and an allowlist, not a wildcard.
- [ ] No tool can read `*.key` / `*.pem` / `*secret*` / `*.env` or run with destructive flags.
- [ ] Creds are task-scoped and short-lived, not one broad session token.
- [ ] All external content (web, email, RAG, API, other agents) is delimited as untrusted.
- [ ] Tool-call args are schema-validated; recipients/domains are allowlisted (exfil guard).
- [ ] HITL is gated by risk class; irreversible/external actions require approval bound to exact params.
- [ ] Memory is validated before store, isolated per user/session, expiring, PII-redacted.
- [ ] Runtime caps exist and fail closed: rate, cost, loop/step, wall-clock timeout.
- [ ] Every tool call is logged (redacted); repeated approval-bypass alerts.
## Incident triage: "the agent did X"
When an agent has already done something it should not have, work the loop in order:
1. **Contain.** Revoke the task tokens / creds the loop is holding; trip the kill-switch
(pause the loop). Stop the bleeding before diagnosing.
2. **Find the trust boundary it crossed.** Which untrusted source reached a privileged
tool? Trace the action's parameters back to their origin — usually an email body, RAG
chunk, fetched page, or a poisoned memory entry.
3. **Purge poisoned memory.** If the bad behavior repeats across sessions, the cause is
stored, not in-context. Delete the contaminated entries; do not just restart the session.
4. **Add the missing gate.** Reclassify that action's risk, move it behind HITL or block,
tighten the tool allowlist, or add the schema/exfil check that would have caught it.
5. **Confirm with a replay.** Re-run the triggering input against the new guardrail and
verify the action is now refused or escalated.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |