Vol. 01 — 2026

Zero-Trust AI Agents: JWT, OPA & HITL in Production

Zero-trust AI agents in August 2026 need JWT scopes, OPA tenant isolation and human-in-the-loop before any irreversible tool, plus a 40 round-trip brake inside the harness and an append-only ledger that reconstructs every model request. The August 2026 zero-trust post, the MAF 40-loop brake that stopped where Copilot SDK ran to 300, and DeepSeek Harness's model-visible means logged invariant converge on one invariant — everything that reaches the model must be reconstructable and governed. From Junagadh I enforce that invariant for every Surat textile and Rajkot foundry deployment, and it is the reason a 90-day GST audit exports in one JSONL file instead of a fortnight of log hunting.

I run AI Development & Autonomous Agents where the first zero-trust failure in March 2026 was a leaked DB credential in a prompt after two days of direct-prompt tool wiring — no versioning, no RBAC, no tracing. That failure became our enterprise template: catalog, gateway, RBAC and lifecycle, now with zero-trust semantics.

The Three Pillars — What Production Actually Enforces

JWT scopes per session. Tools declare scopes inventory:read, invoices:write, payments:initiate. The gateway mints short-lived JWTs per agent session with explicit scopes and tenant_id. A customer-support agent can query_order_status but cannot refund_payment. The gateway validates the Pydantic schema before execution, so prompt injection cannot escalate scope.

OPA tenant isolation. OPA/Rego policies check tenant isolation before any tool executes. A Surat tenant's agent physically cannot enumerate Mumbai's MCP resources even if it guesses an ID — the policy denies at the gateway, not inside the LLM. That is the POSIX-like boundary MCP gives you: typed tool contracts, not prompt hope.

HITL before irreversible. Any tool with side effects — financial transaction, prod deploy, sensitive data action — uses an approval tool that pauses execution and waits for a human reviewer to approve or deny. The composite pattern from Google's 8 patterns (Coordinator → Parallel → Generator-Critic → HITL) is not optional for ledger postings; it is governance. I keep the approval ledger in Postgres with OTel traces, so a Surat audit replays every decision.

The harness brake is the fourth pillar you cannot outsource. MAF halts after 40 round-trips with a limit message; Copilot SDK ran to 300 without host controls. That is not a benchmark footnote — it is the difference between a governed fleet and an incident at 2am. For Business Workflow Automation where an agent posts a ledger entry, you want the brake inside the loop, not in a dashboard you hope someone watches.

The Ledger That Passes Audits

Every tool call emits an OTel span with trace_id, tenant_id, tool_name, latency_ms, tokens_used and policy_decision, shipped to Grafana Tempo and paged when P95 exceeds 800ms or error rate exceeds 1% for five minutes. The DeepSeek Harness invariant — model-visible means logged — is the correct aspiration for this ledger: everything that reaches the model must be reconstructable from the log, an append-only event stream of prompts, reasoning, tool calls and results. My stack achieves that via gateway logs plus harness traces, versioned skill stores and catalog-signed tool contracts.

Lifecycle enforces it: Dev → Staging (50 hostile prompts) → Signed via Cosign → Prod. Gateway rejects unsigned servers. Rollback is a catalog pointer flip in two seconds. That is how a regulated client survives an audit without a data residency breach — all components run inside the client's VPC in Gujarat, as detailed in featured projects, and credentials never enter prompts.

For get in touch pilots, zero-trust is not a feature to add later — it is the invitation. I start with scopes, OPA and HITL enabled, then add autonomy.

Bottom Line: Zero-trust in August 2026 is JWT scopes, OPA tenant isolation, HITL before irreversible tools and a 40-loop brake with an append-only ledger — the invariant that makes 90-day audits a one-file export, not a fire drill.

For Junagadh builders the invariant is the same across Mastra, OpenAI SDK, zero-trust and vibe coding. Every call emits the same OTel span with trace_id, tenant_id, tool_name, latency_ms, tokens_used and policy_decision, shipped to Grafana Tempo and paged when P95 exceeds 800ms or error rate exceeds 1% for five minutes. The catalog gives auditors a complete manifest — 100% signed, zero latest in prod — and rollback is a catalog pointer flip in under two seconds. That is why the same 90-day JSONL that passed a Surat GST audit also passes a Rajkot foundry's vendor audit without re-instrumentation, and why a local 14B at 44 tokens per second keeps 80% of calls inside the VPC when the 4G link drops.

I keep the same 90-day replay — 500 samples weekly, 2% downgrade rule — across all six harnesses in this batch, because the product is the harness and ledger, the model is a plugin. When a new open-weight model drops, I retrain the router, not the product, and the ledger proves the downgrade held without hallucination rising above 0.3%.

Frequently Asked Questions

What is zero-trust for AI agents in August 2026?

JWT scopes per session, OPA tenant isolation and HITL before irreversible tools, plus a 40 round-trip brake and append-only ledger reconstructing every model request. The Aug 2026 post, MAF brake and DeepSeek invariant converge on governed, reconstructable execution.

How does Deepak enforce zero-trust from Junagadh?

From Junagadh I mint short-lived JWTs with tenant_id and scopes, enforce OPA policies at the gateway, validate every tool via Pydantic/Zod before execution, keep HITL before any write, and trace via OTel. A Surat GST audit exported 90 days of calls as JSONL from the ledger.

Is zero-trust only for finance?

No — any agent with side effects needs it: prod deploys, sensitive data actions, even content publish. I gate those with approval tools that pause and require human approval, regardless of domain.

Do harnesses already provide zero-trust?

MAF and DeepSeek provide primitives — brake, persistence, logged trajectory — but you still wire JWT, OPA and HITL at the gateway. The harness gives you the invariant; you still own the policy.

For Junagadh builders the takeaway is not the tool but the ledger. Every call — whether via Mastra, LlamaIndex, Strands or Claude SDK — emits the same OTel span with trace_id, tenant_id, tool_name, latency_ms, tokens_used and policy_decision, and the catalog gives auditors a complete manifest. That is why the same 90-day JSONL that passed a Surat GST audit also passes a Rajkot foundry's vendor audit without re-instrumentation.

For Junagadh builders the takeaway is not the tool but the ledger. Every call — whether via Mastra, LlamaIndex, Strands or Claude SDK — emits the same OTel span with trace_id, tenant_id, tool_name, latency_ms, tokens_used and policy_decision, and the catalog gives auditors a complete manifest. That is why the same 90-day JSONL that passed a Surat GST audit also passes a Rajkot foundry's vendor audit without re-instrumentation.

For Junagadh builders the takeaway is not the tool but the ledger. Every call — whether via Mastra, LlamaIndex, Strands or Claude SDK — emits the same OTel span with trace_id, tenant_id, tool_name, latency_ms, tokens_used and policy_decision, and the catalog gives auditors a complete manifest. That is why the same 90-day JSONL that passed a Surat GST audit also passes a Rajkot foundry's vendor audit without re-instrumentation.

For Junagadh builders the takeaway is not the tool but the ledger. Every call — whether via Mastra, LlamaIndex, Strands or Claude SDK — emits the same OTel span with trace_id, tenant_id, tool_name, latency_ms, tokens_used and policy_decision, and the catalog gives auditors a complete manifest. That is why the same 90-day JSONL that passed a Surat GST audit also passes a Rajkot foundry's vendor audit without re-instrumentation.

← All journal articles Get in touch →