Docs menu
Docs · AI agent signing
Other AI apps and developers
Claude Code and plugin maintenance
Claude Code
Add the marketplace, install or update the plugin, then start a session:
/plugin marketplace add LiminalKeys/claude-plugin
/plugin install liminal-keys@liminal-keys
When prompted, Connect and sign in with your Liminal Keys account (URL-only OAuth — no client ID,
secret, or API key). On Claude Code you can also run claude mcp login liminal-keys in your shell to
(re)authenticate the bundled server name.
Upgrade from an earlier plugin
- Refresh the marketplace
LiminalKeys/claude-plugin. - Run
/plugin install liminal-keys@liminal-keysagain. - Start a new Claude session (do not resume an old thread with a stale skill).
-
Clear a stale local CLI cache if
liminal-signmisbehaves after upgrade:rm -rf "${LIMINALKEYS_SIGN_CACHE:-$HOME/.cache/liminalkeys-sign}"
Anthropic API + LangChain (custom Skill)
For hosts that call Claude via the Anthropic Messages API (LangChain, custom orchestrators), use the
liminalkeys-sign-anthropic custom Skill (0.1.12, same stamp as the plugin):
offline wheels + two-phase prepare (sandbox) / REST sign (host) / embed (sandbox).
See Anthropic API + LangChain.
For ChatGPT Business/Enterprise, use the MCP URL below as a custom server —
ChatGPT MCP. These paths do not replace the Claude.ai marketplace plugin.
Other AI apps (not using the Claude plugin)
Streamable HTTP MCP endpoint (production) for ChatGPT, LangChain hosts, and custom integrations:
https://mcp.liminalkeys.com/mcp
Console → AI agents shows the same URL with a copy button.
Response envelopes are ES256-signed; public keys are at
https://mcp.liminalkeys.com/.well-known/liminalkeys-mcp-keys.json (kid mcp-response-v1).
Optional: API key header (non-OAuth hosts)
The default plugin path uses Connect only — no API key is required.
Some hosts do not support MCP OAuth yet. You can send a Console-issued lkag_… key in
x-api-key instead (one auth mode per request — not both OAuth and a key).
Issue a 30- or 90-day key in Console → AI agents only if you use this path.
MCP tools (four)
list_certificates— allowed signing certificates (client_noncerequired)get_certificate_chain— chain envelope + leaf PEM (certificate_id,client_nonce)sign_hash— RSA signature over a 32-byte digest (digest_base64,document_label,client_nonce; optionalapproval_id,poll_timeout_seconds0–120 default 120,previews)timestamp— optional RFC 3161 via FreeTSA (non-qualified, off unless requested)
v1: RSA / sha256_rsa over a 32-byte digest.
prepare, embed, and validate run locally via liminal-sign — not as MCP tools.
Format-agnostic signing
For non-PDF formats, compute the digest your format requires, call sign_hash, and assemble
the signed artifact yourself — you are responsible for the resulting format and its conformance (PAdES, CAdES, XAdES, etc.).
Signing flow (liminalkeys-sign 0.1.12) — PDF/PAdES helper
One certificate lookup per attempt, then prepare → sign → finish. Do not re-list certificates or re-fetch the chain mid-flow.
-
1
MCP: certificates (once each)
list_certificateswithclient_nonce, thenget_certificate_chainwith a new nonce. Save chain PEM locally (for examplechain.pem). -
2
Local: prepare
liminal-sign prepare --pdf "$PDF" --cert-chain chain.pem \ --out state.json --document-label "Contract Q4"Hashes the PDF in the sandbox, builds a first-page preview for approvers (when policy requires approval), and prepares CMS state. Use
digest_base64andpreviewsfromstate.jsononsign_hash. -
3
MCP: sign_hash (one approval when required)
Call once with the same
client_noncefrom step 1. Long-poll up to 120 seconds. Signing follows workspace policy — when approval is required, approvers act in LK Approvals or on their phone.Resume: After approval, if the call times out or returns
pending_approval, callsign_hashagain with the samedigest_base64,client_nonce, andapproval_id. That collects the signature — it does not create a second approval. Never mint a new nonce after approval. -
4
Local: finish
liminal-sign finish --state state.json --mcp-sign-envelope sign.json \ --expected-nonce "$NONCE" --output signed.pdfEmbeds the signature, runs mandatory validation, and prints the report. Non-zero exit means not successfully signed.
Branded visible stamp (default)
Skill 0.1.12 adds a branded Liminal Keys stamp by default: last page,
bottom-right, 248×96 pt, with dates in the signer’s local timezone
(override with --stamp-locale / --stamp-timezone on prepare).
For a cryptographic signature with no on-page mark, add --invisible-signature on prepare.
Approvals and previews
When policy requires approval, include the preview from prepare in sign_hash
previews on the first call — typically a low-resolution image of the
first page of a PDF (a blank placeholder if it cannot be rendered). The preview and document label
come from the agent and are not checked against the digest; approvers should approve only requests they
recognise. See LK Approvals.
Sample prompts (developers)
| Prompt | Flow |
|---|---|
| List the signing certificates my Liminal Keys agent is allowed to use, with subject and expiry. | list_certificates, get_certificate_chain |
| Sign contract.pdf with our certificate and show the validation report. | chain → prepare → sign_hash → finish (branded stamp by default) |
| Sign contract.pdf with no visible stamp. | prepare --invisible-signature → sign_hash → finish |
| Get a detached signature for the SHA-256 of release-manifest.json labelled “Release 2.1.0 manifest”. | sign_hash (format-agnostic) |
| My signing request is waiting for approval. Keep waiting and finish once approved. | Retry sign_hash with same approval_id + client_nonce, then finish |
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| 401 Unauthorized | Missing or invalid OAuth session or API key | In Claude, reconnect from the plugin's Connectors tab; other apps: re-Connect the MCP URL |
| 403 Forbidden | Conflicting auth headers, or token missing agent connection claim | Single header only for API key path; reconnect OAuth for connector path |
denied | No matching allow rule or explicit deny | Fix policy; do not retry the same request |
pending_approval after 120s | Approvers have not acted yet | Call sign_hash again with same approval_id and client_nonce |
| Duplicate approvals | New client_nonce or new attempt after approval | Reuse the same nonce and approval_id to collect the signature; retries do not open a second approval |
finish / validate failed | Trust anchor or stale state | Use correct chain PEM; do not re-run prepare after sign_hash; show full report |
preview_warnings | Malformed preview image | Fix PNG/JPEG and call sign_hash again on first attempt |
Stale liminal-sign after upgrade | Cached wheels from an older plugin | Upgrade plugin, clear ~/.cache/liminalkeys-sign, start a new session |
Liminal Keys plugin · Sign with Claude · LK Approvals · Console · Security · ← AI agent signing overview