By NHI Mgmt Group Editorial TeamPublished 2026-04-21Domain: Best PracticesSource: Cerbos

TL;DR: Policy generation still depends on getting scope, conditions, and deny-by-default right before a single file is written, according to Cerbos. Its policy skill turns plain-English authorization requirements into schemas, derived roles, policies, and test suites, then validates the bundle against the real compiler.


At a glance

What this is: This is a Cerbos engineering post about a policy-generation skill for AI coding agents, with the key finding that authorization can be generated faster only if requirements are clarified and validated before deployment.

Why it matters: It matters because IAM and security teams need to decide how much trust to place in agent-assisted policy creation, especially where least privilege, explicit conditions, and test coverage determine whether access controls are safe.

👉 Read Cerbos' guide to AI-assisted authorization policy generation


Context

Authorization policy generation is not the same as authorization governance. The hard part is not writing YAML faster, but making sure the policy model actually reflects who can do what, under which conditions, and with which exceptions. In identity programmes, that boundary matters because a small modelling error can create broad access that looks correct on paper.

For IAM teams, the real risk is letting convenience outrun control design. A skill that drafts policies from plain English can reduce friction, but it also inherits the quality of the inputs and the discipline of the review process. That places it squarely in the zone where NHI governance, access modelling, and testing practices overlap.


Key questions

Q: How should security teams use AI to draft authorization policies safely?

A: Use AI to draft, not decide. Require structured inputs for resources, actions, roles, and conditions, then review the generated bundle against least privilege and deny-by-default principles. The safest workflow treats the model as an assistant that accelerates specification and testing, while human approvers retain responsibility for access scope and exceptions.

Q: Why do authorization policies fail when requirements are too vague?

A: Vague requirements hide the real trust boundary. If a team says admins can do everything, the policy may grant unnecessary actions, omit conditions, or create role sprawl that becomes difficult to audit. The failure is usually not syntax, but an incomplete model of who needs access and under what circumstances.

Q: How do teams know whether generated policies are actually safe to deploy?

A: They should verify that the bundle compiles, that tests cover both allowed and denied paths, and that the final rules still reflect the intended business model. Compiler success is necessary but not sufficient. Safe deployment depends on whether the generated policy enforces narrow access with explicit conditions instead of broad inherited permissions.

Q: What should organisations do before letting an AI tool write access rules?

A: Define the policy model first, including principals, resources, actions, and condition logic. Then decide who approves the generated output, how exceptions are handled, and how the policy will be recertified when roles or resources change. Without that lifecycle, AI simply speeds up the creation of brittle access rules.


Technical breakdown

Plain-English authorization intake and policy modelling

The skill starts by translating business language into authorization primitives: principals, resources, actions, roles, and conditions. That sounds simple, but it is where most policy errors begin, because vague statements like “admins can do everything” hide missing constraints, unbounded actions, or overbroad roles. The key technical move is to force specificity before generation begins, then turn that model into schemas and policy scaffolding. In practice, this is policy-as-code with an interactive requirements-gathering layer in front of it.

Practical implication: require a documented access model before any generated policy is accepted into review.

Derived roles, CEL conditions, and deny-by-default controls

The generated bundle uses derived roles and CEL conditions to keep permissions narrow and context-aware. Derived roles reduce role sprawl by reusing shared logic, while conditions let access depend on attributes instead of multiplying static roles. The important control pattern here is deny-by-default, because explicit allow rules are safer than broad grants with exceptions. This is not just a coding preference. It is an authorization design choice that determines whether the policy can be audited, tested, and reasoned about later.

Practical implication: review every generated rule for explicit allow scope and ensure broad access is never assumed.

Compiler validation and iterative policy fixing

After generation, the skill runs the real Cerbos compiler through Docker to validate schemas, policies, and tests as one bundle. That matters because policy errors are often structural rather than syntactic, and a compile step catches mismatches between the intended model and what the engine can actually enforce. The iterative repair loop is also significant: it prioritises syntax, schema issues, compile errors, and failing tests in order, then stops after a bounded number of fixes. That creates a hard limit on automated confidence instead of pretending the agent can resolve every fault.

Practical implication: treat compiler success as a gate, not a convenience, and keep human review on the final policy bundle.


Read our 52 NHI Breaches Analysis report for a comprehensive view of breaches impacting Non-Human Identities including AI Agents.


NHI Mgmt Group analysis

Policy generation is not policy governance. Automating the drafting of authorization files can reduce friction, but it does not remove the need for tight access modelling, explicit scoping, and review discipline. The risky part is not the output format, it is the possibility that the generated policy looks complete while still encoding the wrong trust boundary. Practitioners should treat AI-assisted policy creation as a drafting aid, not an authority source.

Vague authorization requirements remain the real failure mode. This post shows that “admins can do everything” is not a harmless shortcut, it is the point where least privilege begins to fail. The skill’s pushback on broad requests is the right instinct because overbroad requirements are where privilege creep starts. For IAM teams, the lesson is that clarity at intake matters as much as validation at compile time.

Explicit deny-by-default is the control pattern that survives automation. When authorization is generated by an agent, every implicit assumption becomes more dangerous, not less. Narrow derived roles, attribute-based conditions, and test coverage for both allowed and denied paths are the controls that keep policy generation auditable. The practitioner conclusion is simple: if the policy cannot be expressed and tested precisely, it should not be auto-generated into production.

Authorization policy skills belong in the same governance conversation as NHI and agentic access tooling. The moment an AI system helps author access rules, it participates in the trust chain that decides who or what can act. That does not make it autonomous in the identity sense, but it does make the governance problem broader than code generation alone. Security teams should align policy-as-code workflows with identity review, change control, and exception management.

Generated policies need lifecycle discipline, not just syntax correctness. A compiling policy is still only a snapshot of an access model that can drift as roles, resources, and conditions change. The operational gap is the absence of continuous policy recertification, especially when generated bundles are reused across projects or environments. Practitioners should assume that any fast-generated authorization model will age quickly unless lifecycle controls are attached to it.

From our research:

  • 4.6% of all public GitHub repositories contain at least one hardcoded secret, according to The State of Secrets Sprawl 2025.
  • The average estimated time to remediate a leaked secret is 27 days, even though 75% of organisations express strong confidence in their secrets management capabilities.
  • Policy generation and secret governance converge in the same control problem, as explained in Ultimate Guide to NHIs.

What this signals

Policy-as-code workflows are moving closer to identity governance, not farther away. Once AI helps author access rules, the control question becomes whether the generated output can be reviewed, recertified, and retired with the same discipline as any other privileged change. Teams that already struggle with secret sprawl will recognise the pattern: automation speeds production, but governance has to absorb the resulting churn.

The practical signal for IAM teams is that policy generation will increasingly sit beside access reviews, change control, and exception management. If your programme cannot explain who approved a generated rule, what assumptions it encodes, and when it must be revalidated, the policy lifecycle is already lagging the delivery lifecycle.


For practitioners

  • Force access requirements into structured inputs before generation Capture principals, resources, actions, and conditions in a reviewable spec before any policy file is created. Require the author to confirm the scope in plain language, then map that language to enforceable rules.
  • Reject broad grants unless they are converted into explicit action lists Do not accept statements like blanket admin access or unrestricted delete permissions. Convert them into enumerated actions and verify that each action is justified by role and condition.
  • Validate every generated policy bundle against the live compiler Use the actual policy engine, not a mocked lint pass, to test schema fit, role bindings, and condition logic. Keep human review in the loop after the bundle compiles successfully.
  • Separate policy drafting from policy approval Let automation produce the first draft, but route final approval through the same governance path you use for sensitive access changes. Include exception handling, test review, and change logging.

Key takeaways

  • AI-assisted authorization drafting reduces effort, but it does not replace the need for precise access modelling and human approval.
  • The biggest risk is vague requirements that create overbroad roles, missing conditions, and brittle policies that still compile.
  • Practical governance depends on structured intake, compiler validation, and lifecycle controls that keep generated policies auditable over time.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Non-Human Identity Top 10 address the attack and risk surface, while NIST CSF 2.0 and NIST Zero Trust (SP 800-207) set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
NIST CSF 2.0PR.AC-4Access permissions need to be limited and reviewed in generated policy bundles.
NIST Zero Trust (SP 800-207)SC-3Zero trust expects explicit authorization decisions, not broad inherited access.
OWASP Non-Human Identity Top 10NHI-03Generated authorization workflows depend on controlled identity and secret handling.

Treat generated policy automation as governed NHI-adjacent tooling and bound it with review.


Key terms

  • Policy As Code: Policy as code means representing access rules in version-controlled files that can be reviewed, tested, and deployed like software. In identity programmes, this improves repeatability, but only when the policy model is explicit and the review process can catch overbroad rules before they reach production.
  • Derived Role: A derived role is a reusable access pattern built from shared logic rather than copied permission sets. It reduces role proliferation when used carefully, but it can also spread mistakes faster if the underlying conditions or role boundaries are too loose.
  • Deny By Default: Deny by default is an authorization rule that blocks access unless a policy explicitly permits it. It is the safer baseline for modern identity control because it limits accidental privilege expansion and makes every access grant visible, testable, and easier to review.

Deepen your knowledge

Authorization policy modelling, validation, and least-privilege design are core topics in our NHI Foundation Level course, the industry's only accredited NHI security programme. If you are building policy-as-code governance around AI-assisted workflows, it is worth exploring.

This post draws on content published by Cerbos: a skill for generating and validating authorization policies from plain English. Read the original.

NHIMG Editorial Note
Published by the NHIMG editorial team on 2026-04-21.
NHI Mgmt Group — the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org