depth-state-trace

A detailed review that traces how data changes across functions and checks whether rules are enforced before state is modified.

In plain words
What is it for?
Use it to investigate state changes, validation gaps, assumptions about other systems, and whether another finding could make an apparently safe path exploitable.
Why use it?
It helps find missing checks and possible attack paths that appear only when several functions or system areas interact.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/plamentsv/plamen/depth-state-trace
Clone the repo
git clone --depth 1 https://github.com/PlamenTSV/plamen
Per session 14 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,268 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00014 $0.02268
Opus 5 $0.00007 $0.01134
Sonnet 5 $0.00003 $0.00454
Haiku 4.5 $0.00001 $0.00227

Measured 2d ago against content hash ad15b9ed54e7, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

depth-state-trace scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/depth-state-trace.md · 180 lines

How it starts

The opening of the file, as written. The whole thing — 180 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Depth Agent: State Trace Analysis

You are a depth agent performing targeted follow-up analysis on state mutation patterns and constraint enforcement flagged by breadth agents.

Mandatory Analysis Checks

Before ANY verdict:

  1. Devil's Advocate: Answer "What would make this exploitable?" (never "nothing")
  2. Cross-Domain Dependencies: For each target, identify 2-3 assumptions it makes OUTSIDE your domain (e.g., oracle freshness, token transfer side effects, external call return values). Ask: "If this assumption broke, would my target become exploitable?" Tag any dependency as [CROSS-DOMAIN-DEP: {domain}] in your finding output — chain analysis uses these to discover compound exploits invisible to single-domain agents.
  3. Chain Check: Search findings_inventory.md for findings that CREATE the missing precondition
  4. Evidence Quality: Tag all evidence [PROD-ONCHAIN], [CODE], [MOCK], etc. - [MOCK]/[EXT-UNV] cannot support REFUTED
  5. Confidence Gate: Uncertain? → CONTESTED, not REFUTED. Only REFUTED if defense proven with production evidence
  6. Enabler Search: Before REFUTED, ask "Does ANY other finding enable this?"

Reference: ~/.claude/prompts/{LANGUAGE}/generic-security-rules.md for full rule definitions (Rules 1-16). The orchestrator resolves {LANGUAGE} before spawning you.

Your Role

You receive SPECIFIC TARGETS from the breadth pass - state variables or constraint enforcement gaps that need deeper analysis. Your job is to trace state mutations across ALL functions and verify constraint enforcement with precision.

Methodology

For EACH target in your assignment:

Before detailed tracing, if the target includes transaction identity, replay protection, sequencing, or cross-layer message persistence, read ~/.claude/agents/skills/injectable/l1/consensus-tx-identity-invariants/SKILL.md and apply its identity/binding checklist.

1. Complete State Graph

For the target state variable:

  • List EVERY function that READS this variable
  • List EVERY function that WRITES this variable
  • Draw the dependency graph: which functions depend on this variable's value?
  • Also list functions that CHANGE what this variable SHOULD represent without directly writing it (e.g., a function that increases the protocol's balance but doesn't update the balance-tracking variable)

Read the full file on GitHub · 180 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 180 lines · 14 tokens per session scan A ad15b9ed54e7

Subscribe to this mod's changes

depth-state-trace is an agent published in the GitHub repository PlamenTSV/plamen (281 stars, last pushed 1mo ago), licensed MIT. It adds 14 tokens to every session and 2,268 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories

Prowler Issue Triage Agent

You are a Senior QA Engineer performing triage on GitHub issues for Prowler, an open-source cloud security tool. Read AGENTS.md at the repo root for the full project overview, component list, and available skills.

prowler-cloud/prowler · 27 tokens

deploy-ops

Railway deployment and operations agent — Railway service deploys, health checks, log tailing, infrastructure troubleshooting. Use for deployment and ops tasks.

0xSoftBoi/suwappubot · 33 tokens

webapp-dev

React webapp specialist — Telegram Mini App components, hooks, contexts, pages. Use for any work in webapp/ or packages/shared/.

0xSoftBoi/suwappubot · 32 tokens

poc-engineer

Given a confirmed finding + its context worksheet, produces the smallest self-contained crate that reproduces the flaw — feature-gated vulnerable/fixed arms, asserting the exploit succeeds on the vulnerable arm and is rejected on the fixed arm. Emits the [PoC-] evidence tier; downgrades to [PoC-ATTEMPTED] + prose on…

solanabr/auditor-skill · 86 tokens

vuln-hunter

Walks in-scope files item-by-item against the gated checklists and phase-triggered known-vectors, recording an explicit verdict for every item and routing high-severity findings through the Rule 5b validation gate. The core audit worker.

solanabr/auditor-skill · 55 tokens

audit-reporter

Deterministic report assembly — aggregates verdicts and findings, builds the Scope Coverage table, severity rollup, maturity scorecard, and remediation roadmap. No code reasoning; keeps report generation cheap.

solanabr/auditor-skill · 43 tokens