DEV Community

Cover image for The Identity Crisis of AI Agents — And Why Kakunin Might Be Early to a Very Big Market
Palash Bagchi
Palash Bagchi

Posted on

The Identity Crisis of AI Agents — And Why Kakunin Might Be Early to a Very Big Market

The software industry is entering a new architectural paradigm.

We are moving past static microservices, chatbots, and copilots. Instead, we are building autonomous AI agents—probabilistic systems running inside background workers, executing multi-step workflows, hitting APIs, making financial transactions, and interacting with external services with little to no human intervention.

This shift introduces a major security and governance problem:

How do we establish trust, enforce scoped permissions, and cryptographically verify the identity of an autonomous, non-deterministic agent?

If a human executes an action, we use SSO and IAM policies. If a traditional service executes an action, we use API keys or OAuth Client Credentials.

But when a self-directing AI agent starts invoking tools dynamically and modifying its reasoning path, it sits in a dangerous gap. It is neither a static service account nor an accountable human.

This article provides a technical and strategic analysis of Kakunin AI—a startup attempting to solve this by building a machine identity and compliance infrastructure layer (“KYC for AI Agents”) using Public Key Infrastructure (PKI). We will explore their architecture, the technical challenges of runtime governance, and what a developer implementation looks like in practice.

The Core Architectural Asymmetry
In any secure enterprise system, actors must be authenticated and authorized. However, there is a massive difference between traditional deterministic systems and modern agentic architectures:

┌──────────────────────────────────────────────┐
│ DETERMINISTIC MACHINE CLIENT │
├──────────────────────────────────────────────┤
│ Input (X) ──► [Static Rules] ──► API Call (Y)│
│ Identity: Static API Key / Client Secret │
│ Audit: HTTP Logs (Static & Predictable) │
└──────────────────────────────────────────────┘

┌──────────────────────────────────────────────┐
│ NON-DETERMINISTIC AI AGENT │
├──────────────────────────────────────────────┤
│ Prompt (X) ──► [Neural Weights] ──► Tool? ──┐│
│ ││
│ Input (Z) ◄── [Tool Invocation] ◄────────────┘│
│ Identity: ??? (Shared API key / Anonymous) │
│ Audit: Complex Chain-of-Thought logs │
└──────────────────────────────────────────────┘
Traditional API keys and IAM scopes are designed for deterministic paths. If you grant an LLM agent an API key to access your internal database, the LLM has full access to that key’s scopes. If a prompt injection occurs, the agent can be manipulated into executing arbitrary database queries, leading to privilege escalation.

Kakunin AI’s Solution: Cryptographic Agent Identity (X.509 PKI)
To address this, Kakunin AI proposes extending standard Public Key Infrastructure (PKI) primitives directly to model instances. Instead of authenticating via static API keys, each agent is issued a unique X.509 digital certificate backed by a Hardware Security Module (HSM) or cloud Key Management Service (KMS) like AWS KMS or HashiCorp Vault.

Biding Identity to Model Provenance
A key innovation in Kakunin’s architecture is binding the certificate directly to the cryptographic hash of the running model’s weights and system prompt.

If a developer alters the model weights, changes the temperature, or updates the system prompt, the running environment’s model hash changes. This instantly invalidates the certificate, preventing the agent from executing transactions until it is re-credentialed.

Mock Agent Certificate Metadata (JSON Representation)
Here is an example of what the metadata bound to an agent’s cryptographic identity looks like inside the Kakunin gateway:

{
"certificate_id": "cert_agent_sha256_8f39b1a2",
"issuer": "CN=Kakunin Internal Agent CA, O=Enterprise Inc",
"subject": {
"agent_name": "ExecutionAgent-ETH-01",
"environment": "production-eu-west-1",
"owner_email": "compliance-officer@enterprise.io"
},
"validity": {
"not_before": "2026-05-20T00:00:00Z",
"not_after": "2026-06-20T00:00:00Z"
},
"extensions": {
"model_provenance": {
"model_type": "Claude-3.5-Sonnet-v2",
"model_weights_sha256": "8f39b1a2cf93e8201a756b1f2304918e7e1f4094a9a01f92e8c21a4f028bde44",
"system_prompt_sha256": "4e1fa0c31ab456de90123f112ab8e89cf12a023b1ab4c089ee21ff34e098df12"
},
"authorized_scopes": [
"query_anonymized_order_book",
"submit_limit_order"
]
}
}
The Zero-Trust Runtime Flow
When an agent needs to execute an action (e.g., submit a limit order to a matching engine), the request goes through an API Gateway acting as a Kakunin Runtime Enforcement Point:

CEA (Agent) Gateway (PEP) Kakunin OCSP (CA)
│ │ │
│── 1. Signed Request ───►│ │
│ (Cert + payload sig) │ │
│ │── 2. Validate Cert ──────►│
│ │◄── 3. OCSP Valid & Match ─│
│ │ │
│ │── 4. Verify Payload Sig ──│
│ │── 5. Check Scopes ────────│
│◄── 6. Order Confirmed ──│ │
Initiate Request: The agent signs the payload (e.g., order params + timestamp) using its KMS-backed private key and forwards it alongside its X.509 certificate.

Certificate Validation: The Gateway intercepts the request, runs an Online Certificate Status Protocol (OCSP) query to check revocation status, and verifies that the certificate’s cryptographic signature matches the CA trust chain.

Model Provance Check: The Gateway verifies that the running agent’s current model weights and system prompt match the hashes embedded in the certificate.

Scope Verification: The Gateway ensures the requested API endpoint matches the authorized_scopes defined in the certificate metadata.

Code Example: Validating Agent Signatures & Model Provenance
Here is a Python code blueprint showing how an API Gateway / Enforcement Point can validate an incoming agent request, including verification of its cryptographic signature and model weight provenance:

import hashlib
from cryptography import x509
from cryptography.hazmat.primitives.asymmetric import padding
from cryptography.hazmat.primitives import hashes
from cryptography.exceptions import InvalidSignature

Simple database of active, authorized model hashes in production

AUTHORIZED_MODEL_INVENTORY = {
"8f39b1a2cf93e8201a756b1f2304918e7e1f4094a9a01f92e8c21a4f028bde44"
}

def calculate_local_prompt_hash(system_prompt: str) -> str:
"""Calculates SHA256 of the system prompt to prevent prompt injection updates."""
return hashlib.sha256(system_prompt.encode('utf-8')).hexdigest()

def verify_agent_request(
cert_pem: bytes,
signature: bytes,
request_body: bytes,
running_model_weights_hash: str,
running_system_prompt: str
) -> dict:
"""
Validates the agent's signature, matches its X.509 certificate,
and ensures model weights and system prompt have not drifted.
"""
# 1. Load the X.509 Certificate
try:
cert = x509.load_pem_x509_certificate(cert_pem)
except Exception as e:
raise ValueError("Invalid certificate encoding") from e

# 2. Cryptographically verify the request payload signature
public_key = cert.public_key()
try:
    public_key.verify(
        signature,
        request_body,
        padding.PKCS1v15(),
        hashes.SHA256()
    )
except InvalidSignature as e:
    raise ValueError("Cryptographic signature verification failed") from e

# 3. Simulate parsing custom extensions (Model Hashing)
# On Kakunin, these are embedded using Custom OIDs in X509 Extensions
# Here, we extract and compare the expected hashes from the certificate metadata
expected_model_hash = "8f39b1a2cf93e8201a756b1f2304918e7e1f4094a9a01f92e8c21a4f028bde44"
expected_prompt_hash = "4e1fa0c31ab456de90123f112ab8e89cf12a023b1ab4c089ee21ff34e098df12"

# 4. Check model provenance
if running_model_weights_hash not in AUTHORIZED_MODEL_INVENTORY:
    raise ValueError("Model weights are not in the authorized production inventory!")

if running_model_weights_hash != expected_model_hash:
    raise ValueError("Running model weights do not match the certificate's bound model hash!")

current_prompt_hash = calculate_local_prompt_hash(running_system_prompt)
if current_prompt_hash != expected_prompt_hash:
    raise ValueError("System prompt has drifted from the certified configuration!")

# 5. Extract scoped permissions (Simulating reading extensions)
authorized_scopes = ["query_anonymized_order_book", "submit_limit_order"]

return {
    "verified": True,
    "agent": cert.subject.get_attributes_for_oid(x509.NameOID.COMMON_NAME)[0].value,
    "scopes": authorized_scopes
}
Enter fullscreen mode Exit fullscreen mode

Technical Challenges & Strategic Skepticism
While the PKI and signature-verification architecture is elegant, Kakunin faces substantial technical challenges that any developer evaluating the platform must consider.

  1. The Latency Overhead of Cryptographic Handshakes Adding an asymmetric verification step (validating X.509 certificates, decrypting signatures, and performing OCSP checks) before executing database queries or API calls adds latency.

For high-frequency trading (HFT) bots or low-latency matching engines, introducing even 10ms of overhead is a non-starter. Kakunin will need to support fast, cryptographically secure caching strategies (e.g., Ephemeral Session Keys or local CRL caching) to survive in performance-critical environments.

  1. The Non-Determinism Dilemma of Behavioral Monitoring Kakunin claims to go beyond static identity and dynamically monitor “behavioral anomalies” at runtime. But defining what constitutes a behavioral anomaly for a generative agent is extremely difficult.

If an LLM agent alters its tool-calling sequence due to a minor variation in context, does that count as drift?

If the threshold is too tight, developers face false positives that stop production workflows.

If the threshold is too loose, malicious prompt injections or silent adversarial drifts will slip through.

  1. The Trust Bootstrap Cycle Trust systems depend heavily on network effects. API providers won’t add verification handlers if agents don’t use them, and developers won’t implement certificate-based signing if APIs don’t check them. Kakunin will have to open-source its integration wrappers and lobby standard groups (such as IETF or W3C) to drive widespread adoption.

The Broader Picture: AI as an Institutional Actor
The underlying premise of Kakunin AI is that we are moving toward a future where AI systems are no longer just “scripts”—they are quasi-operational institutional actors.

Once an agent can transact money, sign contracts, and access APIs, it requires a verified identity, a human officer of record, and an immutable log of its decisions (the “Rhetoric Audit”).

Whether Kakunin AI survives to define this category depends on how fast the market for autonomous, high-risk agents matures, and how successfully they solve the latency and non-determinism bottlenecks. However, one thing is certain: legacy IAM is not built for the agentic era, and cryptographic machine identity is a logical path forward.

Top comments (0)