agentlens | ← All Guides | Why Governance Matters 15 concepts · 5 phases ← Monitoring | Advanced →
Guide 07 of 9  ·  How do I stay in control?

Governance &
Compliance

Organizational control, regulatory compliance, and accountability frameworks for AI agents in production.

✓ Regulatory-ready 15 governance concepts 5 control phases
Scroll to explore
Part 1
Foundations
What is AI Governance?

Control Across Organizations

Governance is not a feature. It's a system of policies, roles, and enforcement mechanisms that ensures agents behave as intended, comply with regulations, and remain under human control. Three pillars: Policy (what agents can do), Identity (who is the agent? who authorized it?), Accountability (what actions are logged and auditable?).

Without governance, you have chaos. With it, you have predictable, controllable systems.

Governance scales with risk. A chatbot needs minimal governance. An agent that can delete production data needs rigorous governance. Design accordingly.

policy identity accountability

Identity & Authentication

Know Your Agent

Every agent must have an identity: agent_id, version, owner (team), deployment environment. Authentication: can we verify the agent is who it claims? Is it the approved version? Has it been tampered with? Tools: mTLS for agent-to-API communication, cryptographic signatures on agent binaries, hardware security modules for keys in highly sensitive environments.

An unauthenticated agent is an unauthorized agent. You can't audit, revoke, or investigate an agent you can't identify. Identity is foundational.

mTLS agent ID version control

Policy as Code

Rules That Enforce Themselves

Write policies as code, not documents. Example: "Agent X can only read public files, not write, not access PII, not call payment APIs." This policy is executed by the runtime, not interpreted by humans. If the agent tries to violate, the runtime blocks it. Policies are versioned, audited, and can be rolled back.

Policy as code is policy that actually works. A PDF policy is guidance. Code policy is enforcement. Use code.

policy enforcement versioned audit trail

Part 2
Access & Authorization
Authorization Models

Who Can Do What?

Three models: RBAC (role-based: agent has role "data_analyst," role has permissions) — simple, scales poorly. ABAC (attribute-based: grant access if agent.team == "analytics" AND request.dataType == "public" AND time.hour < 22) — complex, scales well. ReBAC (relationship-based: grant access if user.id in resource.readers) — relationship graph, very flexible.

Choose based on your needs. Start with RBAC. Evolve to ABAC if you have many conditions.

Default-deny. Never grant all permissions and revoke exceptions. Always grant only what's needed.

RBAC ABAC default-deny

Delegation & Revocation

Temporary Permission Grants

Sometimes agents need temporary permissions. Example: "For this batch job, access the data warehouse. When done, revoke." Implement: short-lived tokens (15 min expiry), explicit revocation (not just timeout), audit trail (who delegated? when? why?). Never hand off persistent credentials.

Short-lived tokens save you from credential compromise. If a token is leaked, the damage is bounded by time. Persistent credentials leak and nobody knows until months later.

short-lived tokens revocation delegation audit

Audit & Accountability

Answering the Hard Questions

Every permission decision must be logged: "Agent X requested permission to read file Y. Decision: DENIED (policy violation). Timestamp: 2025-04-05T14:32Z." If a user asks "what data did the agent see?" you answer with logs. If a regulator asks "was the agent ever given access to PII?" you answer with logs. Immutable audit trail is non-negotiable.

Logs are your evidence in incident investigations and compliance audits. Without them, you can't defend yourself.

immutable logs GDPR compliance evidence

Part 3
Compliance Frameworks
Regulatory Landscape

GDPR, HIPAA, SOC2, and More

GDPR (EU) — users have right to explanation of decisions, right to deletion, right to data portability. HIPAA (healthcare, US) — agents handling patient data must encrypt, audit, isolate. SOC2 (security/availability/privacy) — required by enterprise customers, demands controls, logging, incident response. PCI-DSS (payment data) — if agents touch credit cards, strict isolation and encryption required.

Compliance is expensive but choosing non-compliance is more expensive (fines, lawsuits, customer losses).

Start compliance conversations early. Building it in from the start costs 1/10th what retrofitting costs.

GDPR HIPAA SOC2 PCI-DSS

Data Residency & Sovereignty

Where Data Lives Matters

Some jurisdictions require data to live in-country. EU citizens' data stays in EU. China's data stays in China. This forces agents to route requests appropriately, use local APIs, never export data. Violating residency requirements = regulatory fines.

Map your agents to data residency zones before you deploy. Changing after launch is hard.

data residency sovereignty compliance

Incident Response & Disclosure

When Things Go Wrong

When an agent causes a breach (exposes PII, makes unauthorized changes, violates policy), you must: (1) Detect it (observability!), (2) Contain it (stop the agent), (3) Investigate (trace logs), (4) Notify stakeholders (data subjects, regulators within timeframe — GDPR: 72 hours), (5) Remediate (fix the bug, prevent recurrence).

Have an incident response plan before the incident. Decide who gets paged, what the steps are, what you'll say to customers. Do this in advance.

incident detection notification remediation

Part 4
Risk Management
Risk Classification

High-Risk vs. Low-Risk Agents

Classify agents by what they can damage if compromised: Low-risk (reads public data, suggests ideas) → minimal controls. Medium-risk (modifies internal data, sends emails) → moderate controls. High-risk (deletes records, moves money, exposes PII) → maximum controls. Each tier demands different governance, monitoring, and approval workflows.

Governance by risk, not by blanket rules. Requiring humans to approve every low-risk agent action is waste. Not requiring approval for high-risk actions is negligence. Match controls to risk.

risk tiers proportional controls blast radius

Red Teaming & Adversarial Testing

Breaking Your Own Agent

Before every major release, deliberately try to break your agent. Prompt injection? Jailbreak? Escalation of privilege? Can you trick it into violating policies? If you find vulnerabilities in red team testing, you fix them before they reach users. If you don't red team, adversaries will find the vulnerabilities for you.

Red team early, red team often. Every change is a new attack surface. Don't wait until launch.

adversarial testing prompt injection vulnerability discovery

Continuous Compliance Monitoring

Staying Compliant Over Time

Compliance isn't a checkbox you mark once. It's continuous. Regularly audit: are agents still following policy? Are logs still immutable? Is access still least-privilege? Schedule compliance audits (quarterly), run automated checks (continuous), involve external auditors (annual).

Compliance drift is real and dangerous. Code changes, policies change, people change. Without continuous monitoring, non-compliance creeps in.

continuous monitoring automated checks audit schedules

Part 5
Organizational Governance
AI Governance Structure

Roles & Responsibilities

Define roles: AI Lead (owns policy), Security Lead (threat modeling, incident response), Compliance Lead (regulatory alignment), Engineering Lead (implementation). Regular meetings: risk reviews (quarterly), incident postmortems (after every incident), compliance audits (annual). Clear escalation: if policy is ambiguous, who decides?

Governance without clear ownership fails. Every policy needs an owner responsible for enforcement.

governance structure ownership escalation

Training & Awareness

Culture of Responsibility

Governance only works if people understand and follow it. Training: all engineers learn about policy, audit, incident response. Quarterly refreshers. Real incident postmortems (sharing what went wrong and how we fixed it) are the most effective training.

People are the strongest governance control. Well-trained teams that care about compliance catch issues before they become incidents.

training awareness culture

Governance Principles

10 Governance Rules

① Identity is foundational — Know every agent.
② Policy as code, not documents — Code enforces, docs don't.
③ Default-deny — Only grant what's needed.
④ Governance scales with risk — High-risk agents need strict control.
⑤ Audit everything — Logs are evidence.
⑥ Incident response plan in advance — Decide before it happens.
⑦ Red team before release — Find your own vulnerabilities.
⑧ Compliance is continuous — Not a one-time checkbox.
⑨ Clear ownership — Every policy needs an owner.
⑩ Culture matters — Trained teams prevent most incidents.