The Signing Key Is Not an Agent Tool
An MCP request may propose a signature or certificate issuance. A narrow broker, outside the model, must decide whether the key may be used.
Written as at 22 October 2026.
hsmpkimcpcloud-securityagent-identity
An HSM can protect a private key from extraction and still sign the wrong thing. That is the distinction an agentic system has to preserve. The hardware protects key custody; the application decides whether this caller, for this task, may ask for this operation on this object.
Imagine MAAH Group’s supplier-onboarding agent. A supplier changes the certificate request for a production robot gateway. The agent can assemble the evidence and propose issuance. It must not receive the CA private key, an unrestricted HSM login, or a generic sign(bytes) tool. This is an illustrative architecture, not a verified MAAH deployment.
The boundary in one request
Agent proposes: issue device certificate for asset R-1042
-> MCP tool carries typed request and caller context
-> certificate broker authenticates user, agent and task
-> broker checks asset registry, CA profile, change ticket and approval
-> CA/HSM adapter performs the permitted operation
-> broker returns certificate ID, public chain and evidence receipt
The broker must re-read authoritative state immediately before the operation. Tool descriptions, retrieved documents and the agent’s narrative are inputs, not authorisation. A replayed approval, an unknown asset or a changed certificate profile must fail before any signing call. The private key stays within the chosen custody service and the agent receives only the result it is entitled to use.
Which integration surface fits?
| Workload | Likely application interface | Design implication |
|---|---|---|
| Existing C/C++ or CA integration that already speaks to HSMs | PKCS#11 | Check the exact service, SDK, operating system, key attributes and mechanism support. |
| Java CA or signing service | JCE provider | Keep the Java broker as the only service with HSM access; agent tools call its narrow business API. |
| Windows certificate service or .NET application using a key storage provider | CNG/KSP | Validate provider and SDK compatibility; do not assume a Windows API gives an agent business authority. |
| Cloud application that needs managed key operations rather than a vendor-neutral HSM API | Provider REST/SDK, such as Azure Managed HSM | Use workload identity, per-key permissions, network controls and logs around the operation. |
AWS documents PKCS#11, JCE and a Windows KSP for CloudHSM. Microsoft’s Azure Cloud HSM documents PKCS#11, JCE and CNG/KSP interfaces; Azure Key Vault Managed HSM is a distinct, fully managed single-tenant service using Key Vault-style APIs. These are alternatives with different ownership and integration trade-offs, not a ranking by industry. A bank, factory or hospital may need a particular assurance or compatibility profile, but the deciding question is the workload’s key custody, protocol, compliance and operational requirement.
Choose the simplest service that satisfies the key and assurance requirement. If an application only needs a managed encryption or signing API, a dedicated HSM integration stack may add needless operating cost. If it must preserve a PKCS#11-speaking CA or control HSM users and partitions directly, a managed-key API may not be a drop-in replacement.
The agentic rule: MCP can carry a request; it cannot approve the request merely because the tool call was well formed. The signing broker enforces the last check and records the exact operation and outcome. The protocol’s authentication work and the enterprise’s business authorisation are different controls.
SAE Chapter 8A develops the PKI and migration decisions. See the books page for its current edition status.
References
- AWS, Client SDKs for AWS CloudHSM, accessed 22 October 2026. https://docs.aws.amazon.com/cloudhsm/latest/userguide/client-tools-and-libraries.html
- Microsoft, Azure Key Vault Managed HSM overview, accessed 22 October 2026. https://learn.microsoft.com/en-us/azure/key-vault/managed-hsm/overview
- Microsoft, Azure Cloud HSM key management, accessed 22 October 2026. https://learn.microsoft.com/en-us/azure/cloud-hsm/key-management
- Model Context Protocol, 2026-07-28 specification release, accessed 22 October 2026. https://blog.modelcontextprotocol.io/posts/2026-07-28/
Related
A Factory Is Not an API Sandbox
Manufacturing agents can analyze and propose, but physical commands require a separate safety and operations boundary that can refuse or stop the action.
A Fraud Graph Is Evidence, Not a Verdict
Graph and vector retrieval can surface hidden relations, but a fraud decision needs typed provenance, time, entitlements, counter-evidence and an accountable reviewer.
An Agent Must Be Able to Retire
Agent retirement is a security operation: revoke identity, remove tool grants, quarantine memory and preserve evidence before deleting the runtime.