The Problem
AI agents operating on-chain face unique risks:- Unbounded spending — an agent with wallet access can send any amount to any address
- Scope creep — an agent authorized for one task (e.g., swap tokens) might attempt unrelated actions
- No audit trail — you cannot easily verify why an agent made a specific transaction
- Prompt injection / manipulation — adversarial inputs can cause agents to take unintended actions
How Newton Solves It
Newton evaluates every agent-initiated transaction against a policy before execution. The policy is a Rego program that encodes your guardrails — what the agent can do, how much it can spend, and which contracts it can interact with.Per-Transaction Spending Limits
Contract Allowlists
Restrict the agent to interacting with approved contracts only:Function-Level Restrictions
Limit which contract functions the agent can call:Time-Based and Rate Limiting
Use a WASM data oracle to track recent agent activity and enforce rate limits:Architecture for Agent Wallets
The agent wallet inherits from NewtonPolicyClient. Every transaction the agent attempts must pass policy evaluation. The agent itself never has direct access to execute arbitrary transactions.Policy Patterns for AI Agents
| Pattern | What it enforces |
|---|---|
| Spending cap | Maximum value per transaction or per time window |
| Contract allowlist | Only interact with approved contract addresses |
| Function allowlist | Only call specific functions (e.g., swap, not transferOwnership) |
| Rate limiting | Maximum transactions per hour/day |
| Human approval threshold | Transactions above a value require off-chain human confirmation |
| Time windows | Agent can only transact during defined hours |
| Destination restrictions | Can only send funds to pre-approved addresses |
Why Newton for Agent Security
| Approach | Limitation | Newton advantage |
|---|---|---|
| Hardcoded wallet allowlists | Inflexible, requires redeployment to change | Policies are updatable via IPFS — no contract redeploy |
| Off-chain policy server | Single point of failure, trust assumption | Decentralized evaluation with cryptographic attestations |
| No guardrails | Agent can do anything | Every action requires policy approval |
| Multisig approval | Slow, blocks autonomous operation | Policies evaluate in sub-seconds, no human in the loop (unless the policy requires it) |
Get Started
Quickstart
Simulate your first policy evaluation in 5 minutes
Write Agent Policies
Author Rego rules for spending limits, allowlists, and rate limiting
Secure Your Agent Wallet
Add NewtonPolicyClient to your agent’s smart contract wallet