Rendered from spec/intent/v1/frameworks.md, “The adapter” in decionis/agent-safe-pipeline at v0.3.5 (b4d5c9e), synced 2026-09-25. The repository is the source of truth. View this file on GitHub
The adapter
The adapter is the few lines between the record and IntentCapture. In the reference test it is
exactly this, once per framework:
// OpenAI: the arguments are a JSON string.
const parameters = JSON.parse(item.arguments) as JsonObject;
const proposal = { action: item.name, target: `shopify:order:${parameters.orderId}`, parameters };
// Vercel AI SDK: the input is already an object.
const proposal = {
action: part.toolName,
target: `shopify:order:${part.input.orderId}`,
parameters: part.input,
};
// LangChain: the args are already an object.
const proposal = {
action: call.name,
target: `shopify:order:${call.args.orderId}`,
parameters: call.args,
};
// The same for all three: the trusted runtime states what the record cannot.
const captured = new IntentCapture().capture(proposal, {
tenantId, // the organization
actor: { id: "synthetic-support-agent", type: "AI_AGENT", runtime: "openai" }, // the principal, from the runtime's own identity
downstreamTarget: { system: "shopify", operation: "refund", endpoint: "POST /refunds" },
context: { source: "conformance", tool_call_id: item.call_id }, // the framework's id, kept for correlation
idempotencyKey: "refund-synthetic-1-openai-v1", // the runtime's retry identity, never the model's id
});
// captured.intentHash is what the authority is asked about and what the grant is bound to.
The target is the adapter's to name because the framework does not distinguish it from the other arguments; which argument identifies the resource is a property of the tool, not of the framework. The framework's call id is kept in the trusted context so the binding correlates with the framework's own record, and it is not used as the idempotency key: it identifies the model's call, and a retry of the same call by the runtime must present the same intent, while a new call with the same id from a different turn must not.
