DeFAI Security Audit — AI Agents in DeFi

DeFAI Audit — A DeFAI audit reviews systems where AI agents interact with DeFi — autonomous traders, AI-managed vaults, intent solvers and agent frameworks holding keys — covering both the smart contract layer and the agent layer, because either one failing loses the same funds.

What a defai audit covers

DeFAI puts a language model in the transaction path. That combines two risk models that were previously separate: a contract that can be exploited by crafted calldata, and an agent that can be redirected by crafted text. An attacker does not need to break your contracts if they can convince your agent to sign.

We audit both halves and, most importantly, the boundary between them: what the agent is authorised to sign, what limits are enforced on-chain rather than in a prompt, whether the strategy can be front-run once its logic is inferable, and what happens when the model returns something unexpected at the worst possible moment.

Vulnerability classes we look for

Unbounded signing authority

Agent keys with no on-chain spend cap, allowlist or slippage bound — where every protection lives in the prompt rather than in code.

Prompt injection into the transaction path

Market data, social feeds, token metadata or memos read by the agent carrying instructions that alter what it trades.

Strategy inference and front-running

Deterministic agent behaviour that is profitable to predict, and public reasoning that leaks the next trade.

Oracle and data-source trust

Agents acting on unauthenticated price or sentiment data, with no sanity bounds and no circuit breaker.

Vault accounting under agent control

Share pricing while positions are open, mid-trade valuation, and deposit/withdraw timing games around agent actions.

Failure and fallback behaviour

What the system does when the model is unavailable, slow or returns malformed output — including whether positions are left unmanaged.

Key custody for autonomous execution

Hot keys on always-on infrastructure, missing rotation, and one key controlling more value than the strategy requires.

Upgrade and prompt-change governance

Who can change the system prompt, the model or the tool list — and whether that authority is weaker than the authority to upgrade the contracts.

In scope

Not in scope unless agreed

How the engagement runs

  1. Scoping and threat modelling

    We fix a commit hash, agree the in-scope contracts and read your architecture docs, then build a threat model: who the actors are, what the trust boundaries are, and which invariants must never break. Nothing is reviewed against assumptions we have not written down.

  2. Manual review

    Line-by-line review by at least two auditors working independently, focused on authorisation, accounting, upgrade paths, external integrations and the gap between what the code does and what the documentation claims it does. Most critical findings come from this phase, not from tooling.

  3. Static and dynamic analysis

    Static analysers appropriate to the language, plus property-based fuzzing and invariant testing to push the system into states no unit test covers. Tooling is used to widen coverage, never to replace the manual pass.

  4. Exploit-path simulation

    Candidate findings are proven on a forked network with a working proof of concept. We report what an attacker can actually do and what it costs them, not a theoretical severity label.

  5. Reporting

    Every finding gets a severity rating, reproduction steps, the affected code, the impact in concrete terms and a specific remediation. You get a draft for discussion before anything is finalised.

  6. Fix review and re-test

    We re-test every remediation against the original proof of concept and check that the fix has not opened a new path. The final report is yours to publish.

What you receive

How we rate severity

SeverityWhat it means
CriticalDirect loss of funds or permanent freezing of assets, exploitable by any actor.
HighLoss of funds or protocol insolvency under realistic conditions, or requiring a privileged actor to misbehave.
MediumBroken protocol behaviour, denial of service, or value leakage that does not directly drain the contract.
LowEdge-case incorrectness with limited impact, or an issue requiring implausible preconditions.
InformationalCode quality, gas efficiency, documentation mismatch and defence-in-depth suggestions.

Pricing

Single token contract: starts from $999, report in 24–48 hours. dApp, GameFi or RWA project: starts from $2,999. DeFi protocol, L2 / rollup, Bridge, ZK circuit, AI agent / MCP: scoped per project after we have seen the code.

DeFAI Audit: frequently asked questions

What is DeFAI?

DeFi systems where AI agents make or execute decisions — autonomous trading agents, AI-managed vaults, intent solvers and agent frameworks that hold keys. The security model has to cover the contracts and the agent, because compromising either one loses the funds.

Can an AI agent be trusted with private keys?

Only inside limits enforced on-chain rather than by instruction: spend caps, destination allowlists, slippage bounds and time locks. If the only thing preventing a bad transfer is the system prompt, the funds are one injection away from gone.

How do you test agent decision manipulation?

We control the inputs the agent reads — price feeds, social data, token metadata, memos — and measure whether crafted content changes its transactions. Then we check which of those transactions the contracts would have rejected anyway.

Do you audit the model itself?

No. We audit the system around the model: permissions, limits, data provenance, output validation and failure behaviour. That is where DeFAI incidents actually happen.

What do you need from us to start an audit?

A repository or contract address, a commit hash to freeze the scope, whatever architecture or spec documentation exists, and a point of contact who can answer design questions. If documentation is thin we will write our understanding of the system back to you and ask you to confirm it — that step alone catches design-level bugs.

How long does an audit take?

A single token contract is 24–48 hours. A typical dApp or mid-sized protocol runs one to two weeks. Large DeFi systems, L2s, bridges and ZK circuits are scoped per project after we have seen the code. We will give you a fixed timeline with the quote, not an estimate that moves.

Is a re-test included after we fix the issues?

Yes. Fix review is part of the engagement, not an upsell. We re-run the original proof of concept against your patched code and confirm the fix has not introduced a new path.

Related security services

Get a fixed quote in 24 hours

Send the repository and a commit hash through the contact form, message @bugtester25 on Telegram, or book a 30-minute scoping call. 200+ protocols audited · $4B+ secured · 0 hacks post-audit. Prefer email? info@safeedges.in.