Skip to content
Johan Peña

Published · 1 min read

Approvals an AI agent cannot talk its way past

When an agent can publish a post or change a customer record, “yes, go ahead” in a conversation is not an approval. Approval of what, with which arguments, under which rules? In Pulse AI the answer is a record the model cannot produce or alter.

Why a chat message is not enough

The AI SDK can pause a tool call and resume it when the user confirms, but that state lives in the chat messages. Pulse AI needed approvals that survive a session, belong to one tenant, and cannot be reused for a slightly different action. So it keeps its own.

What an approval is bound to

Each approval stores a fingerprint of six things: the workspace, the person or agent acting, the tool, its normalized arguments, the target, and the version of the policy in force. Change any of them and the hash is different, so the approval no longer matches.

Pulse AI · packages/policy/src/binding.ts
export type ApprovalBinding = {
  workspaceId: string;
  actorId: string;
  tool: string;
  args: unknown;
  target: string | null;
  policyVersion: string;
};

export function approvalHash(b: ApprovalBinding): string {
  return createHash("sha256")
    .update(stableStringify([b.workspaceId, b.actorId, b.tool, b.args, b.target, b.policyVersion]))
    .digest("hex");
}

The arguments go through stableStringify first: keys are sorted and undefined values dropped, so the same action always produces the same string regardless of how the object was built.

Who executes

The server does, never the model. After a person approves, the server recomputes the fingerprint, checks it against the stored one, and only then runs the action. Tools also never take a workspace or organization id as an argument: the tenant comes from the server session.

The system runs at the lowest autonomy levels on purpose. Reads and internal drafts execute; changes to shared records and every external action wait for a person.

What this does not solve

  • Approvals expire, so a slow reviewer has to be asked again.
  • Model evaluations need gateway credentials, so they run locally or in a manual job, not in CI.
  • There is no multi-factor authentication yet, so an approver account is only as safe as its login.

← All writing