Rightshold™ Sign up

Answers · agent safety

How do I bind a human approver's identity to a content-addressed artifact hash and version before an AI agent can apply side effects?

Last updated

TL;DR: A generic "approved" flag is not enough. Before any side-effecting apply step runs, seal three fields together outside the agent's session: (1) the named human approver from your identity provider (subject, email or employee id — not "the agent said Alice said yes"), (2) a content-addressed hash of the exact bytes or canonical payload that will be applied (SHA-256 of the artifact, config blob, patch, or RFC 8785-canonical JSON of the tool arguments), and (3) the human-readable version or build id that labels those bytes. Hash that triple into the approval action. At apply time, recompute the live artifact hash, re-resolve the approver id from the sealed decision, and refuse unless both match and the version label still names the same digest. request_human_approval binds the yes to the hashed action; verify_human_approval fails if the agent swaps bytes or reuses another person's grant. This is distinct from release-ticket digests alone: the gate is who + which bytes + which version, checked immediately before side effects.

What should I check, step by step?

1. Compute a content-addressed fingerprint of what will be applied: sha256 of the file/image/firmware, or of JCS-canonical tool arguments — never a floating tag (latest) or a mutable branch tip alone.

  1. Record the semantic version or build id as a label on that digest (version → digest map). Reject a version string that no longer resolves to the sealed digest.
  2. Resolve the approver from your IdP or SSO session (stable subject id). Put approver_id, artifact_sha256, version, and environment into the request_human_approval action object so they are hashed together.
  3. Store the signed decision (approver_id, decided_at, artifact_sha256, version, approval_id) in a server DB or ledger the agent's tools cannot UPDATE. Give the agent only the approval_id.
  4. Immediately before the side-effecting call: re-hash the live artifact or arguments; verify_human_approval against that hash; confirm approver_id on the receipt still matches the human who decided.
  5. Fail closed on mismatch, missing approval, expired grant, or a version label that now points at different bytes. Do not apply "close enough" builds.
  6. Append an immutable apply record: who approved, which digest was approved, which digest was applied, when. Prefer append-only rows over edits.
  7. Keep only approval_id (and maybe a display version) in the agent session — never approved=true, never a mutable copy of artifact_sha256 the model can rewrite.

Why must approver identity, content hash, and version travel together?

A yes bound only to a version string ("ship 2.4.1") fails when CI rebuilds 2.4.1 from a different commit. A yes bound only to a digest with no named approver fails an audit: you cannot say which human authorized those bytes.

How do I seal approver, content hash, and version before side effects run?

request_human_approval hashes the action. Put approver_id (from your session, not from agent text), artifact_sha256, version, target/environment, and a short evidence_ref inside action so verify_human_approval fails if any field drifts.

What can go wrong?

Approval UI shows "Alice approved the release" while the action object has no approver_id from the IdP — only chat text the next turn can forge.

How do I ask Rightshold about this (free, no key)?

Add the MCP server https://www.rightshold.com/mcp to Claude, Cursor, ChatGPT, Grok or VS Code, then ask: “Before my agent applies this change, ask me to approve the exact content-addressed artifact (sha256), its version label, and record my approver identity; bind the yes to a hash of those fields and wait for my decision.”

One-click setup

{
  "tool": "request_human_approval",
  "arguments": {
    "summary": "Apply config pack edge-router 1.8.3 (sha256:4e91…) to staging after review by IdP subject alice@example.com",
    "action": {
      "type": "apply_artifact",
      "artifact_id": "edge-router-config",
      "version": "1.8.3",
      "artifact_sha256": "sha256:4e91…",
      "environment": "staging",
      "approver_id": "idp:alice@example.com",
      "evidence_ref": "ci://runs/CFG-902"
    },
    "expires_in_minutes": 60
  }
}

Rightshold records human approvals and signed AI-run receipts for agents that call it. It does not hash your artifacts, resolve your IdP subjects, sit in your deploy pipeline, or stop an apply path that never asks. Enforce the digest and approver compare in your apply gate too. Not legal advice.

What are the sources?

Related

Not legal advice. JSON · Markdown · All answers

Get a free API key in one call

No card and no email needed. 100 free credits; the license and policy checks stay free without a key.

curl -s -X POST https://www.rightshold.com/v1/accounts/signup -H "Content-Type: application/json" -d '{"accept_terms":true}'
export RIGHTSHOLD_API_KEY=rs_...   # the api_key from the reply (shown once)
curl -s https://www.rightshold.com/v1/licenses/check -H "Authorization: Bearer $RIGHTSHOLD_API_KEY" \
  -H "Content-Type: application/json" -d '{"license":"MIT","intended_use":{"commercial_use":true}}'