The guardrail that remembers.
Your agent calls tools. Those tools return real records. Naka sits on that boundary and asks three questions on every single call — and the second one is a function of everything the agent has already been told.
Three decisions, in order, on every call
Each one has a different question, a different input, and a different failure mode. Collapsing them into one check is how products in this category end up shipping a scanner and calling it a guardrail.
Authorize the invocation
Before the tool runs. Cedar evaluates principal, action, resource and context — the role, the session, the tool being called and what it is being called on. A denied call never executes, and is written to the audit table anyway, because a refusal is evidence and an auditor will ask for it.
Authorize each field, against history
The result comes back and is scanned by three detector tiers. Every
entity found is authorized separately, with the ledger of what
this principal already knows about this subject in the Cedar context.
Denied entities are replaced with numbered placeholders —
[PAN_2], not [REDACTED] — so the model can
still reason about, compare and carry the value it is not allowed to
see.
Authorize restoration, bound to a destination
When a placeholder appears in an outbound tool argument, restoring it is
its own Cedar question and the destination is part of it. Plaintext
lives in a process-local vault scoped to one invocation: never
persisted, never logged, never serialized. Without this step the
guardrail is the exfiltration channel — the agent simply asks a tool to
send [PAN_2] somewhere and the mask undoes itself.
A grow-only set, updated atomically
The disclosure ledger is a G-Set keyed by (principal, subject),
stored in DynamoDB and updated with a single UpdateItem carrying
an ADD on a string set.
Concurrency-safe by construction
Two tool calls landing in the same millisecond both apply their additions; neither clobbers the other. A read-modify-write would let them race each other straight past the budget.
Nothing can be un-disclosed
The set only ever gains members. There is no decrement, because a ledger you can decrement is a ledger an attacker can decrement.
It stores types, never values
The ledger records that a PAN was disclosed — not which PAN. The audit API has no field that could carry a plaintext value, which is why the console's before/after panes are reconstructed from counts.
# One round trip. The ADD is applied server-side, so two # concurrent callers both land and neither overwrites. resp = ddb.update_item( TableName = "naka_audit", Key = { "pk": {"S": f"SESSION#{session_id}"}, "sk": {"S": f"LEDGER#{principal}#{subject}"}, }, UpdateExpression = "ADD seen :new", ExpressionAttributeValues = {":new": {"SS": types}}, # ALL_OLD gives the pre-write set, which is what Q2 was # authorized against — so the decision and the record agree. ReturnValues = "ALL_OLD", )
Three tiers, unioned — never subtracted
Later tiers may only ever add findings. A slower, cleverer model cannot un-detect what a checksum already proved.
Tier 1 — local, deterministic
Aadhaar with a Verhoeff checksum, PAN, GSTIN with its state code, IFSC, EPIC voter ID. No network call, no model, no ambiguity. These run first and their findings are final.
Tier 2 — Amazon Comprehend
Names, addresses, phone numbers, emails, dates — the entity classes where a regex is guesswork and a trained model is not. Adds to tier 1's findings; cannot remove them.
Tier 3 — Nova Pro multimodal
The photograph of an Aadhaar card. Indic-script OCR, because that is what these documents actually are — a pipeline that only reads Latin script has a blind spot the size of the country.
Watch it refuse the fourth field.
Four scenarios against the deployed stack, including the two failure cases. A guardrail that only ever says yes proves nothing.