Skip to content
Architecture

One policy bundle. One ledger. Three doors.

The interesting thing about Naka is not any single plane — it is that all three answer to the same Cedar text and write to the same disclosure ledger. A subject's budget spent by an agent is the same budget an employee's paste is charged against, because it is the same person's data either way.

Request path

What happens between a tool and a transcript

AGENT NAKA GUARD STATE tool call transcript Q1 · Cedar may this call run? execute the real tool detect ×3 union, never subtract Q2 · per field against the ledger mask [PAN_2] policy bundle S3 · versioned · ETag audit rows types + counts only disclosure ledger ADD · grow-only Q3 · may this placeholder be restored, and to where?
The dashed line back from the transcript is the one most guardrail designs omit. A masked value that the model hands to an outbound tool must be authorized again, against the destination, before it is restored — otherwise the mask is theatre and the guardrail is the exfiltration path.
Data model

One table, three item types

Single-table DynamoDB with a GSI for the global feed. Sessions, ledger entries and audit rows share a partition, so a session's whole history is one query.

pk

SESSION#<id>

Everything about one session lives together: its calls, its ledger entries, its meters.

sk

CALL#<seq> · LEDGER#<principal>#<subject>

The sort key discriminates the item type. Audit rows sort naturally in call order; ledger entries are addressed directly by the pair that owns them.

gsi1

The cross-session feed

Partitioned by date so the console's live feed is one query against today, with a cursor for older pages — not a table scan.

audit row · what is actually stored
{
  "pk":              "SESSION#demo-4f2a",
  "sk":              "CALL#000004",
  "principal":       "analyst@example.com",
  "subject":         "cust_8814",
  "tool":            "fetch_customer",
  "call_decision":   "Allow",
  "detector_tiers":  ["tier1", "comprehend"],

  // Types and counts. Never values. There is no field
  // on this item that could carry a plaintext identifier,
  // which is why an audit row is safe to keep forever.
  "entities_found":   { "AADHAAR": 1, "NAME": 1 },
  "entities_masked":  { "AADHAAR": 1 },
  "entities_revealed":{ "NAME": 1 },

  "ledger_after":    ["NAME", "PHONE", "EMAIL"],
  "budget":          3,
  "outcome":         "masked",
  "policy_version":   "2026-09-19T14:02:11Z"
}
Deployment

What actually runs, and where

Two Lambdas behind Function URLs in ap-south-1. No VPC, no load balancer, no container registry — the whole stack deploys from one script.

Lambda · arm64 · Python 3.12

A data plane carrying the agent and the guard, and a control plane serving the console, the policy API and the audit feed. Graviton because the workload is I/O-bound and arm64 is cheaper per invocation.

DynamoDB · on-demand

One table, one GSI. The ledger update is a single UpdateItem with an atomic ADD, which is what makes concurrent calls safe without a lock or a transaction.

Comprehend · Textract · Bedrock

Tiers 2 and 3. Each is probed live by the console rather than assumed, so the coverage you see is this account's real entitlement — including when the honest answer is that a service is not enabled.

S3 · policy & sessions

The Cedar bundle is an S3 object with an ETag, which is what gives the policy editor its optimistic-concurrency guarantee: a save built on a stale read is refused rather than silently winning.

Cedar · via cedarpy

The same policy language AWS uses in Verified Permissions. Analysable, which means you can ask whether one bundle is strictly more permissive than another and get an answer — not a code review.

Strands Agents SDK

The guard attaches as an interceptor on the tool boundary. No proxying of the model, no rewrite of the agent, and no place for the application to accidentally bypass it.

Threat model

What Naka defends against — and what it does not

A security product that cannot state its own limits is asking you to trust it on faith.

✓

Gradual re-identification across calls

The core case. An agent, or a principal driving one, accumulating enough individually-permitted fields to reconstruct a person. This is what the cumulative ledger exists for.

✓

Laundering a masked value back out

A model that carries [PAN_2] into an outbound argument and expects it to be restored. Q3 binds restoration to a destination, so the placeholder is not a bearer token.

✓

A detector silently not running

Fail-closed, plus an audit row that records which tiers ran. A gated service reports as NOT_RUN, never as a clean scan.

○

A malicious operator with the shared key

Anyone holding X-Naka-Key can rewrite the policy bundle. There is no approval workflow, no signing and no separation of duties on policy changes. This is a real gap, not a design choice.

○

Multi-tenant isolation

Not implemented. The console is single-tenant and reads are unauthenticated. Deploy it where that is acceptable, or in front of your own authenticating proxy.

○

Within-hop budget enforcement

Every entity in a single tool result is authorized against the same pre-hop ledger state. A record returning ten identifiers at once will release them all against a budget of three; the budget bites on the next call. Sequential within-hop authorization is the obvious next piece of work and is not done.

○

A model that infers rather than reads

Naka governs what a tool returns. It cannot stop a model from guessing a value it was never given, and nothing in this category can.

Read it in the console.

The policy bundle, the detector probes and the audit trail are all live surfaces — not screenshots of an architecture that exists on a slide.