Policy, Governance & Compliance
Guardrails stop bad actions in the moment; governance is the systematic, auditable framework that defines what is allowed, proves it was enforced, and satisfies the regulators who now take a direct interest in autonomous systems. For any platform touching regulated data or consequential decisions, this is not optional polish — it is a precondition for being allowed to operate.
17.1 Policy as code
Authorization rules scattered through application logic are impossible to audit, test, or change with confidence. The discipline is to externalize them into a dedicated policy engine and express them as code. The Open Policy Agent (OPA) is the de-facto standard: policies are written in a declarative language (Rego), versioned in git, tested in CI, and evaluated at runtime by asking the engine a yes/no question — "may this agent, acting for this user, call this tool on this resource?" Decoupling policy from code means rules become a reviewable, centrally governed asset that every component — gateway, tool layer, orchestrator — can consult uniformly. This is the enforcement substrate for least privilege (Ch. 15) and action-gating (Ch. 16).
17.2 The audit trail
Governance requires that every consequential decision be reconstructable after the fact: who (which user, which agent identity), did what (which action, with what arguments), when, under which policy decision, and with what result. The durable execution history (Ch. 4) and observability traces (Ch. 18) already capture much of this; governance demands it be complete, tamper-evident, and retained per policy. An immutable audit log is what lets you answer an incident, satisfy an auditor, and honor a data-subject request.
Treat the audit trail as a first-class output of every action, not a debugging byproduct. An autonomous system you cannot explain after the fact is one you cannot be trusted to run. Decisions, their inputs, the governing policy, and their effects must all be durably and immutably recorded.
17.3 The regulatory surface
Agentic systems intersect several regimes at once. They process personal data (privacy law), they make automated decisions about people (AI-specific law), and they are deployed by organizations that must demonstrate controls (assurance standards). The platform must be built so these obligations can be met by construction.
| Framework | Scope | Key architectural obligation |
|---|---|---|
| GDPR (EU) | Personal-data protection | Lawful basis, data minimization, and right to erasure — incl. deleting derived/embedded copies (Ch. 10); Art. 22 limits on solely-automated decisions with legal/significant effect (human-in-the-loop, Ch. 5) |
| DPDP Act (India) | Digital personal data | Consent management, purpose limitation, data-principal rights, and data-residency considerations — drives where memory and logs physically live |
| EU AI Act | Risk-tiered AI regulation | Risk classification, transparency, human oversight, logging, and documentation for higher-risk uses — phasing in by obligation |
| ISO/IEC 42001 | AI management system | A governance framework for responsible AI: roles, risk management, lifecycle controls — certifiable |
| SOC 2 | Service-org trust controls | Demonstrable security/availability/confidentiality controls — audit trails, access control, change management |
The throughline is that compliance is an architectural property, not a document written at the end. Right-to-erasure means your memory and retrieval layers (Ch. 10, 11) must support targeted, provable deletion — including embeddings and graph nodes derived from the deleted data. Automated-decision limits mean high-stakes actions route through human approval (Ch. 5). Data residency means region-aware placement of stores and logs. Auditability means the trail of §17.2 exists. Build these in from the start; bolting them on later is, in practice, a rewrite.
Two compliance failures are especially common and expensive. Residency: replicating user data or logs into a region the law forbids (a single mis-placed VPC or analytics pipeline can breach DPDP/GDPR). Erasure: honoring deletion in the primary store while stale copies persist in embeddings, caches, backups, and derived graphs. Map every place personal data flows — context, memory, vectors, logs, traces — and ensure each is both region-correct and erasable.