/truent:truent-keysfrom truent
Reviews key custody and deploy safety for smart-contract projects. Finds plaintext private keys in source, scripts, git history, and CI, then analyzes on-chain admin risks like single-EOA owners, low multisig thresholds, unprotected initializers, and upgrade paths across EVM, Solana, Move, and Soroban chains.
Ships in truent. 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.
Review who can move the protocol's money, and how hard that authority is to steal.
Key hygiene is usually treated as an ops checklist ("don't commit your .env")
and contract authority as an audit topic ("who owns this proxy"). They are the
same question asked twice, and treating them separately is how protocols end
up with a hardware-wallet-protected owner on a contract that anyone can
re-initialize. This skill asks both halves together, and the second half is
answered by the engine rather than by reading.
$SKILL_DIR = the directory containing this SKILL.md.
VERIFIED — produced by the Truent engine, with file and line.REASONED — a custody or process judgement nothing executed.Bash: keys in tracked files.
# 64-hex private keys, mnemonics, and the usual key-shaped assignments
grep -rnE '(0x)?[0-9a-fA-F]{64}' --include='*.sol' --include='*.js' --include='*.ts' \
--include='*.rs' --include='*.json' --include='*.toml' --include='*.sh' \
--exclude-dir=node_modules --exclude-dir=lib --exclude-dir=target . 2>/dev/null | head -40
grep -rniE '(private_?key|privkey|mnemonic|seed_?phrase|secret_?key)\s*[=:]' \
--exclude-dir=node_modules --exclude-dir=lib --exclude-dir=target . 2>/dev/null | head -40
Filter the 64-hex hits: most are transaction hashes, bytecode, or salts. A hit is a key only if its name or context says so. Report the ones that are, not the ones that match.
Bash: keys in git history — the check that matters most, because removal
from HEAD does nothing.
git log --all --oneline --diff-filter=A -- '*.env' '*.env.*' '*.key' '*.pem' \
'*keystore*' 'id_rsa*' 2>/dev/null | head -20
git log --all -p --no-color -S 'PRIVATE_KEY' -- . 2>/dev/null | head -60
If a real key appears in any reachable commit, the key is compromised. Say exactly that. Rotation is the only remediation; rewriting history is not, because clones and forks already have it.
Bash: keys reachable from CI and tooling config.
git ls-files | grep -E '(^|/)\.env($|\.)|\.envrc$'
cat .gitignore 2>/dev/null | grep -E '\.env|\.key|keystore' || echo "NOT IGNORED"
grep -rniE 'private_?key|secrets\.' .github/workflows/ 2>/dev/null | head -20
Read every deploy/ops script (script/*.s.sol, scripts/*.ts,
migrations/, Anchor.toml cluster config, Soroban deploy scripts) and check:
PRIVATE_KEY env var
(vm.envUint("PRIVATE_KEY")), or use an encrypted keystore
(cast wallet, --account, a hardware signer)? A raw env var means the key
is in plaintext in the shell, the process table, and probably the shell
history.--broadcast to a mainnet RPC by
default, with no chain-id guard? A deploy script whose default target is
production is one flag away from an accident.truent scan before broadcasting?All REASONED — nothing here is executed.
The custody question the engine can actually answer: given the contracts, who has privileged authority and how well is it guarded?
truent scan <src> --chain <chain> --format json
Then pull out the authority-shaped findings specifically:
truent taxonomy --id SC01 # everything mapped to OWASP Access Control
The detectors that answer this question directly, and what each one means for key custody:
| Detector | The custody question it answers |
|---|---|
evm_single_eoa_admin / sol_treasury_single_authority | Is one hot key the whole security model? |
evm_insufficient_multisig_threshold | Is the multisig a multisig, or a 1-of-n with extra steps? |
evm_unprotected_initializer / sor_reinitialization | Can anyone take ownership by calling initialize first? |
evm_upgrade_path_verification / sor_unprotected_upgrade | Can the admin key swap in arbitrary code with no check? |
evm_missing_signer_check / sol_missing_signer / sor_missing_require_auth | Is the authority check even present? |
evm_shallow_auth | Is the check present but not on the path that mutates? |
move_admin_no_timelock / sol_admin_no_timelock | Can a stolen admin key act instantly, with no window to respond? |
unauthorized_privileged_mutation | Chain-agnostic: any privileged mutation with no guard reaching it. |
These findings are VERIFIED. Report each with its location and its taxonomy
line, and — this is the part that makes the skill worth running — pair it
with the Phase 1/2 custody finding for the same authority. A
evm_single_eoa_admin finding is medium on its own. The same finding, where
Phase 1 found that EOA's key in git history, is critical and immediate.
Write keys-report.md. Lead with the pairing, not the lists:
KEY CUSTODY & DEPLOY SAFETY — <project>
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[CRITICAL] Sole protocol admin is an EOA whose key is in git history
On-chain [VERIFIED] evm_single_eoa_admin — Vault.sol:41
CWE-654 · Reliance on a Single Factor in a Security Decision | SC01 | DASP-2
Off-chain [FACT] PRIVATE_KEY committed in 3f2a1bc (2025-11-02), still reachable
Impact Anyone who has ever cloned this repo can call every owner-gated
function, including withdraw() and upgradeTo().
Action Rotate now, then move admin to a multisig. Rewriting history does
not help — assume the key is public.
[HIGH] <next pairing>
Unpaired on-chain findings
<authority findings with no corresponding custody problem>
Unpaired custody findings
<secrets/process issues with no corresponding on-chain authority>
Not checked
<what this review could not reach: hardware signer policy, multisig signer
identities, off-repo infrastructure>
file:line, or the commit
SHA) and the fact that it is a key. The report may be shared; the key
must not travel with it.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub emmyhack/truent --plugin truent6 skills in this plugin
/truent-auditEngine-first smart-contract security audit across EVM, Solana, Move and Soroban. Truent's compiled engine runs first (static detectors on every chain, a real revm invariant fuzzer on the EVM) and is the ground truth; twelve LLM attacker lenses then hunt the residual, and every property they state is pushed back through the engine. Findings carry one of three evidence tiers, never blurred: VERIFIED-PROVEN (the engine executed it), VERIFIED-STATIC (a compiled detector matched real code), REASONED (a model proposed it, nothing executed it). Modes - default (full repo) or a specific filename. Loop mode runs several passes in one scan, each pass told what the earlier ones found, and ends in one combined report; it remembers findings between scans in a ledger. Triggers on 'truent audit', 'audit', 'audit this contract', 'check this contract', 'security review', 'check for vulnerabilities', 'review for security', 'solidity auditor', 'run the auditor', 'run the auditor in loop mode', 'loop mode', 'run 3 passes'./truent-depsSupply-chain security review of a smart-contract project's dependencies and CI. Finds forked/drifted libraries, unpinned submodules and package versions, and CI workflows that leak deploy keys — then runs Truent's engine over the dependency code that is actually compiled into your contracts, because a patched modifier in a vendored OpenZeppelin is your bug, not upstream's. Multi-chain: Foundry/Hardhat (EVM), Anchor (Solana), Move, Soroban. Triggers on 'truent deps', 'dependency audit', 'supply chain review', 'check my dependencies', 'are my libs safe', 'audit CI workflows'./truent-fuzzStateful invariant fuzzing for smart contracts on EVM, Solana, Move and Soroban. Default path runs Truent's native revm-backed fuzzer — auto-detected invariants, user-written .invar properties, adversarial call sequences, and minimal-PoC shrinking in one binary, no external toolchain. On demand it generates a full fizz-grade Echidna/Medusa suite (setup, handlers, ghost/snapshot properties, coverage loop, campaigns, Foundry repros, report, convert/sync sub-commands) as a strict superset, never lock-in, plus Solana fuzz plans and Move Prover / Soroban test harnesses. Triggers on 'truent fuzz', 'fuzz this', 'fizz', 'invariant fuzzing', 'stateful fuzzing', 'generate fuzz suite', 'build fuzz harness', 'build a fuzz harness', 'fuzzing harness', 'property testing', 'invariant suite'./truent-irOn-chain incident response for a live or past smart-contract exploit. Scopes the damage from the exploit transaction, reproduces the attack against the deployed bytecode with Truent's revm-backed fuzzer to identify the exact broken invariant, and separates confirmed mechanism from speculation before anyone writes a post-mortem. Covers containment, evidence preservation, and the regression invariant that stops a repeat. Triggers on 'truent ir', 'we are being exploited', 'incident response', 'post-mortem', 'we got hacked', 'analyze this exploit tx', 'what went wrong on-chain'./truent-reconPre-audit reconnaissance for a smart-contract codebase, engine-verified. Produces a recon/ folder (recon.md readiness report with threat model, entry-point map, full invariant map, architecture diagram, git-history risk mining, test and doc gaps, verdict) and, unlike a report-only recon, feeds the synthesized invariants into Truent's compiled engine so checkable items come back already checked and the engine's own findings, STRIDE model and exposure chains are part of the map. Multi-chain: EVM, Solana, Move (Aptos, Sui), Soroban. Triggers on 'truent recon', 'recon', 'x-ray', 'pre-audit', 'pre-audit report', 'audit readiness', 'readiness report', 'prep this protocol', 'protocol prep', 'summarize this protocol', 'map this codebase', 'where should I audit'.