API documentation

Agent spending authorization

Let your app ask before it spends. Add user-controlled spending permissions to apps and AI agents with a few lines of code. Decionis Shield is the consumer spending surface of the protocol: the user sets the limits, your agent asks before it spends.

Quickstart — your first spending decision

Your app wants to spend. Shield decides whether it has permission. No policy graphs, signature plumbing, or enterprise organization model is required for first success.

$ npm install @decionis/shield
import { ShieldClient } from "@decionis/shield";

const shield = new ShieldClient(); // sandbox by default
const decision = await shield.authorize({
  amount: 89,
  currency: "USD",
  purpose: "Book hotel",
  merchant: "Hilton"
});

if (decision.allowed) await execute();
Sandbox by default — no real money

ShieldKit 0.1.0 is public. npm artifacts are verified before every release. The client starts in sandbox mode, so the first decision costs nothing and moves nothing.

The three verdicts

Every authorization resolves to exactly one of three answers.

VerdictMeaningYour application's behavior
ALLOWThis exact action is authorized now.Execute once and preserve the decision ID.
ASKThe user must approve.Hold. Execute only after a later ALLOW.
BLOCKThe action is not authorized.Stop. Do not execute.

Handle ASK correctly

Approval is a hold, never a soft allow. Shield orchestrates Presence when the user's rules require human approval. Your application waits for a final ALLOW bound to the same action.

switch (decision.verdict) {
  case "ALLOW":
    await execute();
    break;
  case "ASK": {
    const final = await shield.requestApproval(decision.decisionId);
    if (final.verdict === "ALLOW") await execute();
    break;
  }
  case "BLOCK":
    await cancel();
}

Deterministic sandbox

Understand Shield from one command. Every fixture is labelled sandbox evidence, replays deterministically, and cannot authorize real execution.

npx @decionis/shield-demo --all
ScenarioVerdict
Normal purchaseALLOW
Purchase above automatic limitASK
Subscription below thresholdALLOW
Subscription price increaseASK
Unknown autonomous agentBLOCK
Agent exceeds weekly allowanceBLOCK
Expired spending permissionBLOCK

Choose your surface

One authorization contract, four ways in.

TypeScript — @decionis/shield

Node.js, server agents, and browser-safe sandbox.

Swift — ShieldKit

iOS and macOS with native async/await types.

REST — POST /v1/shield/authorize

One contract for any trusted backend.

MCP — shield.request_purchase

Consumer-friendly tools for agent runtimes.

Enforcement boundary and product hierarchy

Applications must request Shield authorization before executing the consequential action.

Posture — what Shield does and does not control

Shield deterministically controls Shield-integrated execution. Observed activity and sandbox simulations must be labelled as such. Shield does not universally intercept arbitrary card or bank transactions.

Where this sits

Decionis Protocol is enterprise execution authority. Presence is human authorization and verification. Shield is consumer, app, and agent spending authority — the surface this page documents.

Build a Shield-compatible spender

Start in sandbox, handle ASK correctly, inspect the dossier, then complete production identity and compatibility validation.

The consumer product this authorizes against is Decionis Shield (App Store); the SDKs, the MCP server and the rest of the developer surface are on decionis.ai.