The Complete Production SOP: How to Deploy and Run Manticore Symbolic Execution for Binaries & Contracts in Autonomous AI Agents
Production SOP to install and run Manticore Symbolic Execution for binaries and EVM smart contracts in Codex, Claude Code, and Cursor with verified solvers.
Technical Overview & Architectural Context
Dynamic symbolic execution and SMT constraint solving require precise orchestration of path exploration, memory hook registration, and solver state management. When autonomous coding agents attempt binary reverse engineering or EVM bytecode analysis without structured SOPs, they frequently generate unconstrained symbolic buffers, produce path explosion by looping over unbound variables, or attempt to run native solvers without isolating workspace state. This results in process hangs, exhausted SMT memory limits, and hallucinated constraint satisfaction. By mounting the `manticore-symbolic-binary-executor` skill into Codex, Claude Code, Cursor, or Windsurf, the agent is constrained by deterministic procedures derived from Trail of Bits best practices. The skill enforces systematic initialization (`Manticore(binary_path)`), bounded symbolic buffer allocations, targeted program counter (PC) hooks, and strict evaluation of satisfiable state solutions through the underlying Z3 engine. This eliminates state-space explosion and ensures reproducible, concrete input recovery within secure workspace boundaries.
Prerequisites & Environment Requirements
Verified Search Intents & Long-Tail Queries Solved
This operational tutorial is engineered to provide deterministic solutions for these developer search queries:
Step-by-Step Execution Playbook
Local Environment Setup & SKILL.md Mounting
Create the local skill manifest directory and inject verified procedural rules.
Autonomous agent runners scan project-level and global configuration trees for SKILL.md files. Injecting the verified manifest ensures the agent's LLM context is conditioned with strict symbolic execution workflows before evaluating binary analysis prompts.
mkdir -p ~/.agents/skills/manticore-symbolic-binary-executor && cat << 'EOF' > ~/.agents/skills/manticore-symbolic-binary-executor/SKILL.md
---
name: "manticore-symbolic-binary-executor"
description: "Analyze binaries and EVM smart contracts with symbolic execution and constraint solvers."
metadata:
author: "Trail of Bits"
version: "1.0.0"
runtime_compatibility:
- "codex"
- "claude-code"
- "cursor"
- "windsurf"
triggers:
- "run manticore analysis"
- "symbolic execution binary manticore"
- "generate inputs manticore"
permissions:
fs_read: true
fs_write: "workspace"
shell_exec: false
net_access: false
---
# Manticore Symbolic Execution for Binaries & Contracts
Applies dynamic symbolic execution using Trail of Bits Manticore: symbolic input generation, path exploration, detecting reachable assertion failures, and analyzing Linux ELF binaries.
## When to Invoke
Invoke this skill whenever you need to:
- run manticore analysis
- symbolic execution binary manticore
- generate inputs manticore
## Execution SOP & Rules
1. Initialize Manticore instance with m = Manticore(binary_path).
2. Define symbolic buffers using m.make_symbolic_buffer(size).
3. Register hooks on target memory addresses to inspect solver constraints.
4. Extract concrete input byte sequences from satisfiable execution paths.
## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
EOF---
name: "manticore-symbolic-binary-executor"
description: "Analyze binaries and EVM smart contracts with symbolic execution and constraint solvers."
metadata:
author: "Trail of Bits"
version: "1.0.0"
runtime_compatibility:
- "codex"
- "claude-code"
- "cursor"
- "windsurf"
triggers:
- "run manticore analysis"
- "symbolic execution binary manticore"
- "generate inputs manticore"
permissions:
fs_read: true
fs_write: "workspace"
shell_exec: false
net_access: false
---Place the SKILL.md in project-level `.agents/skills/` or `.cursor/skills/` to prevent global context pollution across non-security repositories.
Manticore requires native Linux execution semantics. On macOS Darwin hosts, run your agent runtime inside a Linux Docker container or WSL2 to avoid Mach-O ELF loader panics.
Environment Secrets & Dependency Validation
Inject required environment variables safely and configure the Python symbolic solver dependencies.
Manticore depends on the Z3 theorem prover and system-level libffi/binutils. Set solver memory caps and process worker limits in the local workspace configuration so that symbolic explorations do not consume all host resources during automated agent iterations.
python3 -m venv .venv && source .venv/bin/activate && pip install --upgrade pip && pip install manticore z3-solver && cat << 'EOF' >> .env.local
MANTICORE_WORKSPACE=.manticore_workspace
MANTICORE_SOLVER_TIMEOUT=60
EOFExport `MANTICORE_SOLVER_TIMEOUT` to prevent infinite branch exploration when handling complex nested loops in compiled binaries.
Verify `.manticore_workspace/` is added to `.gitignore`. Manticore writes extensive state trace dumps that will inflate git history if checked in.
Intent Matching & Trigger Invocation
Verify deterministic activation using tested natural language prompts.
Instruct the agent runtime with explicit trigger phrases to ensure the skill SOP is referenced. The agent creates an automation script using `m.hook()` rather than generating unconstrained shell loops.
import sys
from manticore.native import Manticore
def solve_crackme(binary_path, target_address, avoid_address):
m = Manticore(binary_path)
# Create a 32-byte symbolic input buffer
symbolic_input = m.make_symbolic_buffer(32)
@m.hook(target_address)
def reached_success(state):
solution = state.solve_buffer(symbolic_input)
print(f"[+] Solved input: {bytes(solution).decode('latin-1')}")
m.kill()
@m.hook(avoid_address)
def reached_failure(state):
state.abandon()
m.run()
if __name__ == "__main__":
solve_crackme("./challenge.elf", 0x4011d6, 0x4011ea)Include the target binary path and known target instruction offsets directly in the prompt to reduce intermediate file introspection calls.
Verification, Linting & Output Quality Gate
Execute automated self-healing checks before accepting agent deliverables.
Run type-checking on the generated Python harness and execute the script against the target ELF binary. Confirm that the solver outputs the expected concrete payload and terminates with exit code 0.
python3 -m py_compile solve_binary.py && python3 solve_binary.pyCheck `manticore_workspace` summary metadata with `manticore --dump-state` to verify no branch states remained unhandled.
Real-World Scenario: Recover Concrete Password Trigger for an ELF Authentication Binary
“Run manticore analysis on ./bin/auth_check to generate inputs manticore finds that reach the 'Access Granted' code block at address 0x401250, avoiding 0x401265.”
Runtime Troubleshooting & Failure Modes
Root Cause: The symbolic variable size is too large or the binary path involves non-linear arithmetic / hash routines, causing the underlying Z3 solver to exhaust its time budget before discovering a satisfiable model.
m = Manticore(binary_path, solver_timeout=30)
# Constrain symbolic buffer length to minimal necessary bounds
symbolic_buffer = m.make_symbolic_buffer(16)Root Cause: Manticore native binary engine relies on host Linux ptrace and CPU virtualization semantics, which fail on macOS Darwin kernels.
docker run --rm -v "$PWD":/workspace -w /workspace trailofbits/manticore python3 solve_binary.pyFrequently Asked Questions (Manticore Symbolic Execution for Binaries & Contracts SOP)
Q:Can I use Manticore Symbolic Execution for Binaries & Contracts across Codex, Claude Code, and Cursor simultaneously?
Yes. The skill conforms to the universal SKILL.md specification supported across all modern agent runtimes. Simply mount it in each runtime's designated skills directory.
Q:How does Manticore Symbolic Execution for Binaries & Contracts prevent context window overflow during long agent sessions?
By establishing concise procedural boundaries and deterministic validation gates rather than polluting system prompts with redundant rules. The agent receives exact API usage rules, avoiding multiple failed trial-and-error code generation turns.
Q:Does this skill require escalated root or container permissions?
No. It is audited with a security score of 98/100 and runs safely within workspace-scoped sandboxes using local Python environments and unprivileged SMT solver subprocesses.
Ready to equip your autonomous agent with Manticore Symbolic Execution for Binaries & Contracts?
Copy the complete audited SKILL.md specification or download the 1-click zip bundle directly from our verified registry.