New:Socket for Asana Is Now Available.Learn more
Sign In

@decionis/shield

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@decionis/shield

Ask a user's Decionis Shield for spending authority before your app or AI agent executes.

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

Consumer Spending Authorization for TypeScript

Decionis Shield SDK — let your app or AI agent ask the user's Shield before spending their money.

Install

npm install @decionis/shield

Published on npm as @decionis/shield.

Thirty seconds to a decision

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();

No account or key is required in sandbox. No real money can move.

Handle all three verdicts

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();
}

An error is not permission. The SDK fails closed and every ShieldError has safeToExecute: false.

Deterministic scenarios

const decision = await shield.authorize(
  { amount: 267, currency: "EUR", purpose: "Book hotel" },
  { scenario: "travel-approval" }
);
// ASK — hold until approval

Run all scenarios with npx @decionis/shield-demo --all, or npm run shield:demo:all from this repository.

Production

DECIONIS_SHIELD_ENV=production
DECIONIS_SHIELD_API_KEY=shield_pk_...
const shield = new ShieldClient({
  environment: "production",
  identity: {
    appId: "app.travel.example",
    displayName: "Example Travel Agent",
    developer: "Example, Inc."
  }
});

Production keys belong on servers, never in browsers. Production provisioning is not yet self-service; the client intentionally refuses to run without both a key and integration identity.

API

  • authorize(request, options?)ShieldDecision
  • requestApproval(decisionId) → current ShieldDecision
  • getDecision(decisionId) → current ShieldDecision
  • getDossier(dossierId) → evidence and advanced metadata
  • sandboxScenarios → deterministic local fixtures

The package is TypeScript-first, ESM, dependency-free at runtime, Node.js 20+, and browser-safe for sandbox use. See the five-minute quickstart and REST contract.

Enforcement boundary

Applications must request Shield authorization before executing the consequential action. Shield does not universally intercept arbitrary card or bank transactions.

License

Apache-2.0. Use of the hosted Shield service is governed separately.

Keywords

ai-agent-spending

FAQs

Package last updated on 22 Aug 2026

Related posts