/trappsec:add-detectionfrom trappsec
Instruments existing validation and authorization checks to emit OpenTelemetry findings when impossible inputs are received, detecting business-logic probing, IDOR, and tampering without changing app behavior.
Ships in trappsec. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You are making the application's existing defenses report on themselves. Most apps already reject the inputs an attacker sends while probing business logic: a price that doesn't match the catalogue, a role the form never offers, a refund for an order that was never paid, another tenant's project ID in a request body. They reject them quietly, so nobody learns that someone tried. Each such rejection, where no real client could ever have produced the input, is a detection waiting to happen.
The judgment calls are yours:
| Property | In practice |
|---|---|
| Impossible | No real client can produce the input: not the current UI, not an older version still in use, not a retry, a race or a double click. A detection a real user can trigger is a bug. |
| Existing | It instruments a check the app already makes. The app's response and behavior stay exactly as they were. |
| Silent | Nothing in any response reveals that the check now reports. |
| Attributed | The finding shares its trace with the request's server span, which names the account, credential, tenant and client. |
| Meaningful | It points at an intent worth acting on: privilege, money, other tenants' data, workflow integrity. |
| Proven | You have triggered it, and shown that the real client's flows never do. |
Look for these where validation or authorization already rejects them:
/requests/${id}/approve). IDs in page URLs usually don't qualify: shared links, bookmarks and stale tabs carry them. One lookup of the rejected ID, to tell another tenant's object from a deleted one, is allowed; make it on every rejection of that kind, so response time doesn't tell the caller which IDs exist. Objects the app itself lets the caller reach across tenants (break-glass, sharing, support access) are excluded: check the links it renders, not only its forms.Not detections: typos, expired sessions, values a real user can type, concurrent edits, retries, an option retired recently enough that open tabs still send it, and refusals a real user can reach (a role revoked under an open tab, a state another user just produced). When a rejection is ambiguous, leave it alone.
Which clients. A form sends only its options; a script on a public API, an SDK or an AI agent can send anything the schema allows. A condition qualifies only if no client of the app could produce it, so check each example against every client's code. Where some clients can send anything (scripts on API keys), scope the rule to the credential types whose clients you can read, and say so in the inventory; tokens issued by one login endpoint are one class, so scope by issuer (a claim), never by "bearer". For a client you can't read (a mobile build without source), take the evidence from the server instead: what it ever hands that account. A client holds only the IDs and values the server listed or returned to it, so a request for a record the server never showed the account (another employee's payslip, when the list is filtered to the caller's own and a payslip never changes owner) is impossible from any client, readable or not. Check the one way it isn't: a person who holds two accounts and switches between them in one browser, where a page or tab loaded as the first sends the second's session. Where the client keeps such state across a sign-in, the rule needs a fact stale state can't supply, or it isn't a detection. A missing client source never takes a whole surface off the map.
If you find an impossible state the app doesn't reject, that's a vulnerability, not a detection. Report it; don't fix it as part of this work unless the user asks.
For each candidate rejection, write down:
Keep every candidate whose evidence holds for every client, and only those: a plausible rule is a false positive waiting, and a certain one is worth keeping however many there are. List the rejected candidates and why in the plan, so the next agent doesn't add them back. Inputs at a chokepoint that the app ignores rather than refuses are handed off to add-deception, and inputs it accepts are vulnerabilities (references/attack-paths.md).
Unless the user already told you to go ahead, show the plan and wait:
| # | Path / stage | Rule ID | Endpoint / operation | Condition | Why no real client produces it | Intent |
|---|
Then list, from the attack-path map, the inputs handed off to add-deception and the chokepoints left uncovered and why.
errors entry in a 200. Record on the specific error code or kind the check raises, never on any validation error; a validator without an error code may be given one where the code never reaches the response. Where one error answers several refusals, record in the branch that decides, not on the error. A check the app also uses to filter what it lists (a permission test behind a list endpoint) records where a request is refused, never inside the shared check. Never pass the classification through the response.security.flagged set, and passes the client.address check.Date, request IDs, CSRF and other random tokens, JSON key order. No data changed that didn't change before.Every rule is real product code, and someone will eventually refactor the check it lives in. The inventory, the markers and the tests keep the detection alive. In a private repository, add a short note to the repo's agent instructions (AGENTS.md or CLAUDE.md; create AGENTS.md if there are none) naming the rules and asking agents to keep them when they change the surrounding validation. In a public repository the inventory and markers are visible too; a detection still works when it is known, because the check refuses anyway, so keep them, add no note, and tell the user.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub trappsec-dev/trappsec --plugin trappsec4 skills in this plugin
/add-auditingAdd an audit trail to an application the user owns: what people, services and agents do in the product, from everyday changes to its core objects to sign-ins, permission changes, sharing and exports, as self-contained OpenTelemetry audit records in the product's own terms. Use this whenever the user wants audit logs, a user activity log or history, an audit trail, compliance logging (SOC 2, ISO 27001, HIPAA), a customer-facing audit log API, or a record of authorization decisions. Not for debugging logs, metrics, tracing setup or detecting attacks./add-deceptionDesign and add deception to an application the user owns: decoy API routes, honey fields and frontend lures that blend into the app's real code, wired to identity-attributed alerts and verified never to affect legitimate users. Use this whenever the user wants to add decoys, honeypots, honey fields, canary endpoints, tripwires or lures to their own web app or API; wants to detect signed-in users probing business logic (hidden admin routes, mass assignment, privilege escalation, cross-tenant access); wants bait in their frontend that leads to decoys; or wants an existing deception setup reviewed, extended or made more convincing. Inputs the app already refuses are add-detection's. Not for anti-spam form honeypots, UI focus traps, WAFs, rate limiting or vulnerability scanning./add-telemetrySet up OpenTelemetry traces, logs and metrics in an application the user owns, so every request has a server span, the app's own log records carry its trace, and everything is exported over OTLP. Use this whenever the user wants to add OpenTelemetry, tracing, distributed traces, OTLP export or log correlation to their app, or when add-auditing, add-deception or add-detection stopped because traces and logs were missing. Not for custom business metrics, dashboards, alerting, deploying a Collector, or instrumenting LLM calls.Other plugins' skills for the same job