audit-deep

audit-deep is a command for coding agents from omermaksutii/RugProof. It costs 28 tokens per session (650 once invoked), scanned A, original, MIT.

A deeper smart-contract audit command that runs multiple review passes and uses more specialist reviewers than a standard audit. It also checks whether separate findings can combine into a larger attack.

In plain words
What is it for?
Use it to coordinate specialist audits, adversarial review, gas review, invariant checks, cross-contract call tracing, and comparisons with historical security findings.
Why use it?
It is intended for reviews where broader coverage and exploit-chain analysis matter more than speed, such as before launching on mainnet.

Command

Part of the rugproof plugin — 35 commands, 23 agents shipped together

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 commands/omermaksutii/rugproof/audit-deep
Clone the repo
git clone --depth 1 https://github.com/omermaksutii/RugProof

Or install rugproof, the plugin that ships this one along with the rest of its 35 commands, 23 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for audit-deep

README.md
[![agentmods](https://agentmods.dev/badge/commands/omermaksutii/rugproof/audit-deep.svg)](https://agentmods.dev/commands/omermaksutii/rugproof/audit-deep)
Your own site
<a href="https://agentmods.dev/commands/omermaksutii/rugproof/audit-deep"><img src="https://agentmods.dev/badge/commands/omermaksutii/rugproof/audit-deep.svg" alt="Measured on agentmods" height="20"></a>
Per session 28 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 650 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.00028 $0.00650
Opus 5 $0.00014 $0.00325
Sonnet 5 $0.00006 $0.00130
Haiku 4.5 $0.00003 $0.00065

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

Security

Grade A, and why

audit-deep 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 4d 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.

commands/audit-deep.md · 58 lines

How it starts

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

/audit-deep — multi-pass adversarial audit

Like /audit, but slower and more thorough. Use this for pre-launch or pre-mainnet-fork reviews where time is acceptable but escapes are not.

Differences vs /audit

  1. Two-pass review. First pass: per-skill findings. Second pass: cross-finding analysis — can any two findings be combined into an exploit chain?
  2. More specialist dispatches. Always invoke attacker AND defender AND gas-optimizer AND any matching protocol specialists.
  3. Cross-contract reachability. Trace external call graphs: which functions can call which, with what authorizations? Look for trust violations across the call graph.
  4. Invariant generation pass. Spawn invariant-writer to identify protocol invariants that the contract intends to hold; check each one against the code.
  5. Historical context. Use c4-history and sherlock-history MCPs to look for similar findings in the historical database — protocols of this type have lost funds via X; does this code have X?

Procedure

Run /audit end-to-end first. Then:

Pass 2: Exploit-chain hunt

For each (high or critical) finding F:

  • Could F be amplified by another finding? E.g. flash-loan + price oracle + missing access control → drain.
  • Could F be amplified by an external integration (a specific token, a specific oracle behavior)?
  • Generate at least one candidate exploit chain per Critical finding.

Pass 3: Invariant violation hunt

Run invariant-writer to extract:

  • Token: totalSupply == sum(balanceOf)
  • Vault: totalAssets >= sum(convertToAssets(balanceOf))
  • AMM: K = reserve0 * reserve1 monotonically non-decreasing after swap fees
  • Lending: sumDebt <= sumCollateralAtPrice * MAX_LTV

For each invariant, prove or break it. If broken, emit a finding.

Pass 4: Historical pattern match

For each Critical / High finding, query c4-history-mcp and sherlock-history-mcp:

  • Has a protocol of this type ever lost funds to this exact pattern?
  • Cite the historical incident in the finding write-up.

Read the full file on GitHub · 58 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. 4d ago First seen · 58 lines · 28 tokens per session scan A 25fbeab47f3a

Subscribe to this mod's changes

audit-deep is a command published in the GitHub repository omermaksutii/RugProof (9 stars, last pushed 1mo ago), licensed MIT. It adds 28 tokens to every session and 650 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-31.