SDK and MCP
No wallet connected. Connect one to act as the owner or operator of a vault. You can read everything here without a wallet.
Keyless tools
No account, vault or keyUsable by any agent on NEAR, including agents that never touch our vault. aruna_check_target answers whether a contract can still change under you, and hash-based checks are blind to global_by_account.
| Tool | Input | Returns |
|---|---|---|
| aruna_check_target | account_id, optional network | class, evidence, one-line reason |
| aruna_watch_target | account_id | resolved code hash now, state of all four drift channels, last observed change |
| aruna_explain_class | class | what the class means and what can still change |
| aruna_read_vault | vault_id, optional network | owner, operator and ceiling; every agent with policy, status, usage and key permissions; what agents and the operator cannot do; exposure per target |
Vault tools
Need a registered agent key| Tool | Input | Returns |
|---|---|---|
| aruna_simulate | action params | verdict allow or block, reason, target class, premium impact |
| aruna_spend | action params | execution result, or a refusal with its reason |
| aruna_budget | none | balance, spent today, reserved, remaining |
| aruna_exposure | none | exposure per target, each with its class |
aruna_simulate is a free view running the same checks without a transaction, so a refusal costs no gas. Its result is not binding: state can change before the transaction lands. It also returns the target's recorded class and the premium impact of the action, which is the policy-to-price chain at the moment of decision.
Refusal reasons
SDK codes are the contract values without ARUNA_| Contract value | SDK code | Counts toward auto-disable |
|---|---|---|
| ARUNA_TARGET_NOT_ALLOWED | TARGET_NOT_ALLOWED | Yes |
| ARUNA_MAX_PER_TX_EXCEEDED | MAX_PER_TX_EXCEEDED | Yes |
| ARUNA_DAILY_CAP_EXCEEDED | DAILY_CAP_EXCEEDED | Yes |
| ARUNA_SLIPPAGE_TOO_HIGH | SLIPPAGE_TOO_HIGH | Yes |
| ARUNA_RISK_CLASS_NOT_ALLOWED | RISK_CLASS_NOT_ALLOWED | No: a target can be reclassified under an honest agent |
| ARUNA_TARGET_FROZEN | TARGET_FROZEN | No: a freeze hits every honest agent on the target |
| ARUNA_CLASS_STALE | CLASS_STALE | No: routine, and absorbed by the SDK |
| ARUNA_INSUFFICIENT_BALANCE | INSUFFICIENT_BALANCE | No: the owner's funding, not the agent's behaviour |
| ARUNA_AGENT_NOT_ACTIVE | AGENT_NOT_ACTIVE | No: already stopped |
| ARUNA_AGENT_AUTO_DISABLED | AGENT_AUTO_DISABLED | No: already stopped |
A policy refusal is a successful tool call returning verdict: "block" with a reason. Only authorization and transport failures are tool errors. Flattening refusals into errors teaches agents to catch and ignore them.
Deliberately left out
- Coverage purchaseAn owner action, done from the console with the owner's account. Never reachable by an agent key, in any layer.
- Approval queuesaruna_simulate has two verdicts, allow and block. There is no needs_approval.
- ReceiptsNo module backs them, so they are dropped until one exists.
- Key managementThe server never creates accounts, adds keys or funds allowances.
- Free-form (target, method, args)It would make the vault a generic proxy and destroy containment.
- Automatic retry on a policy refusalA refusal means the agent must not do it. Stale-class refresh is different and is handled in the SDK, once.
Run it
Two runnable examples ship in examples/, and neither needs a paid API key: honest-agent.ts is a rule-based loop that simulates, spends and logs refusals with their reason, and injected-agent.ts is the same loop with poisoned text in its context. The second attempts a payout to an unlisted address and is refused twice, once by the protocol and once by the vault.