← Blog

LLM Request Signing: A Verification Profile for Model API Calls

Parminder Singh
Parminder Singh··5 min read
Summarize with AI

HTTP Message Signatures can authenticate selected parts of an LLM API request, while Content-Digest can bind the transmitted prompt body to that signature. The useful security property comes from a strict deployment profile: covered components, signer resolution, algorithms, freshness, replay handling, proxy transformations, and negative tests all need explicit rules.

Platform & Architectureai-securityidentity-and-authorizationllm-securityzero-trustarchitecture
LLM Request Signing: A Verification Profile for Model API Calls

An LLM request can carry a valid bearer token while its method or destination tells a different story than the caller intended. The prompt body can differ too. HTTP Message Signatures address that gap by building a signature base from selected message components. A verifier reconstructs the same base and resolves the signing credential. It then checks the signature before accepting the call.

The cryptography is the short part. The deployment profile decides what the signature means. I would block a rollout that signs one convenient header and labels the entire request trusted.

TL;DR

  • RFC 9421 signs selected HTTP components, so the profile must name every component the verifier requires.
  • RFC 9530 Content-Digest binds the transmitted body only when the digest field is covered by the signature.
  • Replay handling needs message coverage and freshness limits. It often also needs a nonce store.
  • Signatures add integrity and signer authentication. TLS, authorization, routing controls, and signing-credential lifecycle remain separate.

RFC 9421 signs selected components

RFC 9421 defines detached signatures or message authentication codes over components of an HTTP message. The signer chooses covered components, canonicalizes their values, includes signature parameters, and produces a value carried in the Signature field. Signature-Input tells the verifier which components and parameters built the signature base.

Selection creates both the capability and the main failure mode. A valid signature protects covered components. An unsigned query parameter or header can still change request processing. RFC 9421 therefore requires an application profile to define expected component identifiers, signature parameters, signer retrieval, allowed algorithms, credential-context rules, error behavior, and any request-response binding.

For an LLM inference call, I would start with the method and authority, followed by the path and content type. I would also cover the content digest and any identity or destination fields that the application actually trusts. The exact set depends on the API and intermediaries. A copied profile is dangerous when the route rewrites fields differently.

Content-Digest binds the prompt body

RFC 9421 points to the HTTP digest mechanism for message content. RFC 9530 defines Content-Digest for conveyed content and Repr-Digest for representation data. For a JSON inference request, Content-Digest can represent the bytes transmitted in the HTTP content.

A bare digest supplies weak protection against an active attacker. RFC 9530 explains that an on-path actor can remove it or replace it with a digest calculated over modified content. Covering Content-Digest with the HTTP Message Signature binds the body digest to the signed request. The verifier should calculate the digest over the received content and compare it using an allowed hash algorithm. It should then verify that the digest field itself is covered.

The physical detail is one line in a request capture: content-digest appears inside the ordered component list. If it appears only as a header below that list, the signature has not bound the body.

Freshness and replay need state

RFC 9421 defines the created, expires, and nonce signature parameters. Creation and expiration times let the verifier enforce a narrow validity window with an explicit clock-skew allowance. A nonce can give each signed message a unique value, provided the verifier remembers accepted values long enough to reject reuse.

Time alone leaves replay inside the accepted window. A nonce without storage is decorative. Sufficient component coverage also matters because two similar requests may otherwise validate against the same signature. Bind the signature to the method, target, and content that distinguish one model call from another.

Write down the accepted clock skew and maximum age. State the expiration requirement and nonce format. Add the nonce retention period and the behavior when the replay store is unavailable. Fail-closed behavior belongs in that profile. The AI gateway fail-closed guide covers the operating choice at the request boundary.

Signer lookup carries the signer identity

The keyid parameter is an identifier for verification material. It is not proof of identity by itself. The verifier needs a trusted resolution method that maps the identifier to cryptographic material and an approved signer context. It must also reject algorithms or credential types outside the profile, even when the mathematical signature verifies.

Keep signer identity separate from the authenticated human behind the application. Agents require the same separation. One workload credential shared by twenty callers proves that the workload signed the request. Per-user authorization requires verified caller context and a policy decision that understands it. The identity-aware AI gateway architecture describes that handoff.

Rotation needs overlap rules, revocation, and evidence. Record when new material becomes valid and when old material stops. State how cached verification material expires. Then send a request signed by the retired material. A rotation plan without that negative test is paperwork.

Proxies change the signed message

HTTP intermediaries can transform messages. A reverse proxy may change authority, normalize a path, combine field values, add forwarding metadata, or reserialize content. RFC 9421 includes canonicalization rules for permitted transformations, yet application-specific rewriting can still break verification or create a mismatch between what the signer covered and what the origin processes.

Choose the verification point deliberately. One pattern verifies the client signature at the first trusted proxy and applies policy there. The proxy then creates a new signature for the origin over the forwarded request. The origin trusts the proxy's signing credential and profile. Preserve the relationship between the inbound and outbound records with a correlation identifier outside the security claim unless that identifier is also signed.

Test the deployed chain rather than a direct localhost request. Include the load balancer and ingress, followed by the policy proxy and model adapter. The AI gateway TLS termination guide maps the neighboring transport boundary.

Acceptance tests prove enforcement

Positive tests show interoperability. Negative tests show that verification is active. Submit a valid request, then alter the body without updating the digest. Change a covered path component and remove Signature-Input. Use an unknown signing identifier, a disallowed algorithm, an expired signature, a future creation time beyond skew, and a repeated nonce.

Each case needs an expected HTTP result and a retained verifier reason that avoids leaking useful verification information. RFC 9421 warns that signatures protect messages only when verifiers actually check them; valid requests can succeed even if verification is accidentally disabled. The invalid cases expose that configuration failure.

Record the signer context and verified components. Keep the digest result, freshness result, credential version, authorization decision, and final route. Never store private signing material or bearer credentials in the test artifact.

DeepInspect

DeepInspect can participate only when authenticated user or agent traffic is deliberately routed as HTTP through the proxy to an LLM endpoint. At that boundary, a deployment can verify the chosen request-signature profile before policy evaluation, provided the product integration explicitly implements the required RFC 9421 and RFC 9530 behavior. This article makes no claim that such support exists in a current DeepInspect release.

For routed traffic, the policy record can keep signature-verification status beside verified caller context, content classification, destination model, policy version, and outcome. Direct model calls that bypass the proxy remain outside control. Request signing also leaves TLS, credential custody, upstream identity proofing, provider authentication, and replay-store operation with their respective owners.

Book a technical deep dive at deepinspect.ai.

Frequently asked questions

Does request signing replace TLS?

No. RFC 9421 states that message signatures provide integrity for covered components and provide no confidentiality. TLS protects information in transit between its endpoints and helps prevent signature capture. Use both, with TLS configured for the deployed connection path.

Does a valid signature authorize model use?

A valid signature establishes that an approved credential signed the covered components under the profile. Authorization still decides if that signer or user may call the selected model with this data and operation. The same decision applies to an agent. Keep signature verification and policy evaluation as separate recorded outcomes.

Should responses be signed too?

Response signing can bind selected response components and, when profiled carefully, parts of the triggering request. It needs its own covered-component rules and signing material. It also needs freshness handling and verification tests. Start from the evidence requirement rather than assuming request and response profiles should match.