Docs menu

Docs · AI agent signing

Other AI apps and developers

Integrator paths (not the business Claude plugin flow): Anthropic API + LangChain · ChatGPT MCP

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

  1. Refresh the marketplace LiminalKeys/claude-plugin.
  2. Run /plugin install liminal-keys@liminal-keys again.
  3. Start a new Claude session (do not resume an old thread with a stale skill).
  4. Clear a stale local CLI cache if liminal-sign misbehaves 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)

Using Claude? Install the marketplace plugin instead — do not add this URL as a second connector alongside the 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_nonce required)
  • 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; optional approval_id, poll_timeout_seconds 0–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. 1

    MCP: certificates (once each)

    list_certificates with client_nonce, then get_certificate_chain with a new nonce. Save chain PEM locally (for example chain.pem).

  2. 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_base64 and previews from state.json on sign_hash.

  3. 3

    MCP: sign_hash (one approval when required)

    Call once with the same client_nonce from 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, call sign_hash again with the same digest_base64, client_nonce, and approval_id. That collects the signature — it does not create a second approval. Never mint a new nonce after approval.

  4. 4

    Local: finish

    liminal-sign finish --state state.json --mcp-sign-envelope sign.json \
      --expected-nonce "$NONCE" --output signed.pdf

    Embeds 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)

PromptFlow
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

SymptomCauseFix
401 UnauthorizedMissing or invalid OAuth session or API keyIn Claude, reconnect from the plugin's Connectors tab; other apps: re-Connect the MCP URL
403 ForbiddenConflicting auth headers, or token missing agent connection claimSingle header only for API key path; reconnect OAuth for connector path
deniedNo matching allow rule or explicit denyFix policy; do not retry the same request
pending_approval after 120sApprovers have not acted yetCall sign_hash again with same approval_id and client_nonce
Duplicate approvalsNew client_nonce or new attempt after approvalReuse the same nonce and approval_id to collect the signature; retries do not open a second approval
finish / validate failedTrust anchor or stale stateUse correct chain PEM; do not re-run prepare after sign_hash; show full report
preview_warningsMalformed preview imageFix PNG/JPEG and call sign_hash again on first attempt
Stale liminal-sign after upgradeCached wheels from an older pluginUpgrade plugin, clear ~/.cache/liminalkeys-sign, start a new session

Liminal Keys plugin · Sign with Claude · LK Approvals · Console · Security · ← AI agent signing overview