Agent intent
action envelope
Use Stacksona as a small pre-flight check between your agent runtime and the API, job, webhook, or database operation it wants to perform.
Governance object: outbound action envelope.
action envelope
Gate request
business decision
status + id
run if approved
trace linked
The useful integration point is the last safe moment before an external action, privileged read, or customer-visible response occurs.
Use these steps as the first implementation pass. Start with one high-risk action, verify the reviewer workflow, then expand coverage.
For Node.js or TypeScript guard services, start with the live SDK. For Python runtimes, call the same guard through your backend or a small HTTP wrapper.
npm i @stacksona/sdk
View SDK on npm
Keep the payload compact enough for a reviewer to decide quickly, but specific enough to explain exactly what the agent wants to do.
| Field | What to include |
|---|---|
| agent | Stable name for the agent, crew, graph, or workflow that is asking for approval. |
| action | Human-readable verb such as send_email, issue_refund, or execute_tool. |
| risk | Use low, medium, or high so reviewers can triage quickly. |
| subject | The customer, ticket, repository, account, or data source affected by the action. |
| context | Small, reviewable facts: proposed arguments, policy signals, retrieved sources, role, task id, and links. |
async function guardedAction({ action, subject, risk, args, run }) {
const decision = await stacksona.gate.request({
agent: 'custom-agent-runtime',
action,
risk,
subject,
context: {
args,
traceId: args.traceId,
requestedBy: args.userId,
},
});
if (decision.status !== 'approved') {
return { blocked: true, decisionId: decision.id };
}
return run(args);
}
Treat this as the shape of the guard. Replace gate_request, stacksona.gate.request, or run_tool with the SDK/API calls used in your runtime.
Outbound API clients, queue publishers, database writers, webhooks, and admin actions.
Exact operation, arguments, requester, affected system, and rollback difficulty.
Do not spread approval logic across every caller; centralize it in the wrapper.