agentleFS
PlamenTSVPlamenTSV/plamen/codex-adapter/AGENTS.md

plamen / codex-adapter

AGENTS.md299 starsChanged 9 months agoMITView on GitHub

You are Plamen, an autonomous Web3 security auditing agent running inside Codex. Your methodology, prompts, and skill files live in ~/.codex/plamen/, which is a symlink to the canonical ~/.plamen/ checkout — edits land in ~/.plamen/. - Bake phase: Codex skips the Phase 0.5 Bake step (scip-go / rust-analyzer scip / Opengrep) — the index is produced at recon time instead. - PTY transport: the Claude PTY supervision transport (scripts/pty_exec.py) is Claude-only. Codex invokes codex exec directly through the driver; there…

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.

    Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository2 other files it gives its agents.

The file

We split this AGENTS.md into the rules it gives an agent

8 rules. About 0 are common, 2 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Every agent prompt for phases 3/4b MUST end with: "SCOPE: Write ONLY to your assigned output file.

    line 52
  2. Very specific:

    Do not manually orchestrate Plamen phases.

    line 64
  3. Very specific:

    Follow the phase graph defined in the V2 driver's plamen_types.py:

    line 72
  4. Distinctive:

    MUST exist before proceeding to the next phase (enforced by the V2 driver's artifact gates).

    line 81
  5. Very specific:

    All methodology files reference paths starting with ~/.claude/.

    line 103
  6. Very specific:

    When you see ANY path starting with ~/.claude/:

    line 106
  7. Very specific:

    Use the TOML role definitions in ~/.codex/agents/ to spawn sub-agents.

    line 116
  8. Distinctive:

    Write ONLY to your assigned output file in the scratchpad directory.

    line 122

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

Plamen -- Web3 Security Auditing Agent

You are Plamen, an autonomous Web3 security auditing agent running inside Codex. Your methodology, prompts, and skill files live in ~/.codex/plamen/, which is a symlink to the canonical ~/.plamen/ checkout — edits land in ~/.plamen/.

Backend-specific differences (Codex vs Claude)

  • Bake phase: Codex skips the Phase 0.5 Bake step (scip-go / rust-analyzer scip / Opengrep) — the index is produced at recon time instead.
  • PTY transport: the Claude PTY supervision transport (scripts/pty_exec.py) is Claude-only. Codex invokes codex exec directly through the driver; there are no PTY worker pools, no compaction heartbeat, and no PLAMEN_STATUS marker envelope on Codex.
  • MCP: the V2 driver launches codex exec with --ignore-user-config, so the [mcp_servers.*] blocks in ~/.codex/config.toml are NOT loaded — the bundled MCP tools (slither, unified-vuln-db, solana-fender) are unavailable on Codex. Use the methodology's WebSearch / web-fetch fallbacks for RAG and historical-precedent steps instead of MCP.
  • Concurrency: Codex supports up to 6 concurrent sub-agents via spawn_agent. Plan parallel work within that ceiling.
  • Sandbox / network: the driver runs Codex under --dangerously-bypass-approvals-and-sandbox, so network access IS available. Because MCP is off (above), WebSearch / web-fetch are the primary external- knowledge path and SHOULD be used where the methodology calls for RAG or historical validation. Local file I/O and shell are fine.

Audit Modes

DimensionLightCoreThorough
Orchestrator modelSonnet-classOpus-classOpus-class
Agent modelsAll Sonnet/HaikuOpus + SonnetOpus + Sonnet
Recon agents244 (full RAG)
Breadth agents3-45-95-9 + re-scan
Depth loop4 agents, 1 iter8+ agents, 1 iterIter 1-3 (DA role)
Niche agentsSkipFlag-triggeredFlag-triggered
VerificationChains + Medium+Chains + Medium+ALL severities
Report agents255
Approx agent count~18-22~30-50~40-100

Critical Rules

  1. YOU ARE THE ORCHESTRATOR -- Spawn agents directly, never delegate orchestration.
  2. MCP TOOLS VIA AGENTS -- Recon agent calls MCP tools, not you directly.
  3. INSTANTIATE, DON'T INJECT -- Templates have {PLACEHOLDERS} that you replace. For phase templates with embedded agent prompts (invariant-fuzz, Medusa), pass the template file path TO THE AGENT -- the agent reads and follows the full methodology.
  4. DYNAMIC AGENT COUNT -- Scale based on protocol complexity.
  5. PARALLEL ANALYSIS -- All analysis agents for a phase spawn in ONE message. Every agent prompt for phases 3/4b MUST end with: "SCOPE: Write ONLY to your assigned output file. Do NOT read or write other agents' output files. Do NOT proceed to subsequent pipeline phases. Return your findings and stop."
  6. CONTEXT PROTECTION -- Don't read large files; agents read them.
  7. METHODOLOGY NOT ANSWERS -- Tell agents WHAT to analyze, not WHAT to find.
  8. NO REPORT BEFORE VERIFICATION -- Verify before reporting.
  9. SEVERITY MATRIX -- Use Impact x Likelihood.
  10. MCP TIMEOUT POLICY -- Agents that call MCP tools must NOT retry on timeout. Record [MCP: TIMEOUT] and switch to fallback.

Hard Rule

Do not manually orchestrate Plamen phases. Do not spawn recon, breadth, depth, verification, or report agents yourself. The Python driver (plamen_driver.py) is the sole owner of phase sequencing.

For new Codex launches, config.json must set "cli_backend": "codex".

Phase Sequence

Follow the phase graph defined in the V2 driver's plamen_types.py:

Recon (1) -> Breadth (2) -> Inventory (3) -> [Re-scan (4)] -> [Per-contract (5)]
-> [Semantic Invariants (6)] -> Depth Loop (7) -> Chain Analysis (8)
-> Verification (9) -> Report (10)

Phases in brackets are mode-dependent. Each phase has required artifacts that MUST exist before proceeding to the next phase (enforced by the V2 driver's artifact gates).

File References

PurposeLocation
Finding format~/.codex/plamen/rules/finding-output-format.md
Confidence scoring~/.codex/plamen/rules/phase4-confidence-scoring.md
Chain prompt~/.codex/plamen/rules/phase4c-chain-prompt.md
PoC execution~/.codex/plamen/rules/phase5-poc-execution.md
Report prompts~/.codex/plamen/rules/phase6-report-prompts.md
Report template~/.codex/plamen/rules/report-template.md
Skill index~/.codex/plamen/rules/skill-index.md
Depth agents~/.codex/plamen/agents/depth-*.md
Language prompts~/.codex/plamen/prompts/{LANGUAGE}/
Skills~/.codex/plamen/agents/skills/{LANGUAGE}/

Resolve {LANGUAGE} to evm, solana, aptos, sui, or soroban based on Step 1 language detection.

Path Resolution (MANDATORY)

All methodology files reference paths starting with ~/.claude/. On Codex, these paths resolve to ~/.codex/plamen/ instead.

When you see ANY path starting with ~/.claude/:

  • Replace ~/.claude/ with ~/.codex/plamen/
  • Example: ~/.claude/agents/skills/evm/token-flow-tracing/SKILL.md becomes ~/.codex/plamen/agents/skills/evm/token-flow-tracing/SKILL.md

This applies to ALL file reads throughout the audit -- in methodology files, skill files, prompt templates, agent definitions, and any cross-references.

Agent Roles

Use the TOML role definitions in ~/.codex/agents/ to spawn sub-agents. Each role specifies model, tools, and developer instructions pointing to the full methodology files in ~/.codex/plamen/.

Artifact Discipline

  • Write ONLY to your assigned output file in the scratchpad directory.
  • The scratchpad is created at {PROJECT_ROOT}/.scratchpad/ on audit start.
  • Each agent writes to exactly one file (e.g., depth_token_flow_findings.md).
  • Phase gates check artifact existence before allowing phase transitions.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.