Policy as Code for Agents: What Changes When the Caller Is Not a Person
Your policy engine has a caller every time an agent asks to release a payment, and the first job is to say who that caller is. In policy as code, IBM defines the caller as the piece of code that asks the policy engine for a decision. That answer is tidy until the caller is no longer just carrying a user’s request from a screen to a service. With AI agents, the useful control question moves from “is this user allowed?” to “is this proposed action allowed, on these facts, at this point in the workflow?”
Key Takeaways
- Policy as code is the practice of managing IT policies like software code, not a separate legal regime or a promise that policy judgement has disappeared.
- The ordinary policy as code pattern depends on a caller that normalises data and sends it to a policy engine for a decision.
- For AI agents, the policy as code claim is narrower: organisational rules and controls can be translated into machine-readable code that restricts agent actions.
- Logging is part of the agent-control argument, but a log is only useful if it records the facts that mattered to the decision.
- Policy as code is not the whole governance system for agents, and Kyndryl says it remains only one building block.
Policy as code AI agents can actually obey
Policy as code is not a new name for a policy document. IBM defines it as “a practice for managing IT policies like software code,” and Black Duck defines it as a method for defining and managing security rules, criteria, and conditions through code. Those definitions matter because they keep the term grounded. A board-approved sentence is not policy as code until some system can apply it to a concrete request.
"Policy-as-code is a method of defining and managing security rules, criteria, and conditions through code."
— Black Duck, What Is Policy as Code and How Does It Work?, 13 February 2026
The old mental model is simple. An application receives a request from a user. The application asks a policy engine whether the request is allowed. The engine answers from rules and data. The application then allows, blocks, or sends the matter for review.
That model does not collapse when the requester is an AI agent. It just becomes less forgiving. A human may click “approve supplier” after seeing an invoice, a sanctions result, and a supervisor note. An agent may gather material, summarise it, and propose the same approval. Kyndryl describes a banking example in which AI agents gather data and assess risks in Know Your Customer workflows. The policy check now has to deal with a caller that may have selected the facts it presents.
This is the caller problem. Policy as code usually asks whether the system received the right data. Agentic use also asks whether the action was assembled from the right basis. If an agent proposes a changed credit limit, the rule cannot merely ask whether the customer record exists. It may need to know whether the agent used the current income record, whether the change exceeds an operational threshold, and whether a human approval is required. The point is not that policy as code magically knows those things. The point is that it gives the organisation a place to make the action conditional on them.
Kyndryl’s agentic AI framing is explicit that enterprises can translate organisational rules, regulatory requirements, and operational controls into machine-readable code that restricts AI agents’ actions. That is a useful claim, but it should not be inflated. It does not prove that every regulation has been captured correctly. It does not prove that the agent’s input was complete. It only says the control can be expressed in a form that a system can apply before an agent acts.
The distinction is practical. A natural-language policy might say that refunds over a threshold need approval. Policy as code turns that into a test against a proposed refund action. With agents, the proposed action might not come from a predictable button or a fixed form. It may be composed from a conversation, a retrieved record, and a generated plan. The policy test therefore has to be close enough to the action to see what is being attempted.
How does policy as code work when the request is composed
IBM’s description of the ordinary pattern starts with the caller. The caller normalises data inputs, hands those inputs back to the policy engine, and the policy engine runs policy code against them. Black Duck adds that policies are written in a high-level language and entered into a policy engine that uses queries. That is enough to explain the basic architecture without pretending that the architecture solves every governance problem.
"A caller—the piece of code that asks the policy engine for a decision—normalizes data inputs."
— IBM, What Is Policy As Code?, 18 June 2026
There are three moving parts in the useful version of the pattern. First, the organisation writes rules in a form a machine can evaluate. Second, a caller sends facts about the proposed action. Third, an enforcement point acts on the answer. Kyndryl describes Policy Decision Points and Policy Enforcement Points as the parts used to develop rules that determine whether an action should be allowed and whether it violates policy.
That last phrase is important. “Whether an action should be allowed” is narrower than “whether the agent is good.” A policy engine is not a moral examiner. It is not an auditor by itself. It answers the question it is given, using the data it receives and the rules it has.
For a deployment change, IBM gives a plain example of a denial: if the decision is deny, the policy engine blocks pull requests and code merges and stops the deployment until remediation. IBM also says that if the decision is deny, the change fails to merge into the main code branch. Those examples sit in software delivery, not in agent runtime. The structure still helps: a proposed change is tested before it takes effect.
For an agent, replace the deployment with a concrete external action. The proposed action might be a deleted record, a released payment, a changed credit limit, or a message sent to a customer. The policy engine should not be asked, “is this agent trusted?” That is too coarse. It should be asked whether this action, with this amount, for this customer, based on this source, may proceed now.
Spacelift states the same general mechanism in broader terms: policy as code uses code to define, manage, and enforce policies within a system. It also defines a policy as a set of rules or guidelines governing decisions and actions within a system. Those are ordinary definitions, but they expose the weak point. If the system does not expose the agent action as a decision, there is nothing useful for policy as code to govern.
This is where vague agent governance breaks. A slide can say that an agent follows policy. A runtime path either asks for a decision before the agent touches the thing that matters, or it does not. If the request is not normalised, the engine cannot apply consistent rules. If the facts are missing, the engine cannot infer them safely. If the answer is advisory only, the action may still happen.
None of this requires treating policy as code as the only control. It is a control point. It gives the organisation a place to ask for structured facts, apply rules, return a decision, and record what happened. It does not decide which rules are lawful, fair, or commercially acceptable. Those remain human governance decisions.
Why policy as code is attractive and where it stops
The basic reason to use policy as code is repeatability. Black Duck says codifying conditions that trigger security events helps reduce friction in standardising application security for agile environments. Spacelift lists common use cases including infrastructure governance, security compliance, and access control enforcement. IBM says policy as code has a wide range of applications for enterprise IT architectures.
Those claims are not about AI agents specifically. They explain why the practice spread before the current agent conversation. If a rule is expressed as code, it can be reviewed, tested, changed, and applied more consistently than a paragraph that someone has to remember during a release meeting.
"Development, operations and security teams can all review, discuss and update policies through familiar workflows (code reviews, branching strategies), which makes policy discussions more transparent and more integrated into everyday development work."
— IBM, What Is Policy As Code?, 18 June 2026
For agents, the attraction is sharper. Kyndryl says policy as code can make AI agent behaviour predictable by helping ensure agentic AI execution is consistent and strictly controlled. Kyndryl also says that applying policy as code to agentic AI allows regulated enterprises to make agent actions consistent, traceable, and explainable. That is the strongest version of the case.
It is still not a complete case. “Consistent” can mean consistently wrong if the rule is wrong. “Traceable” can mean traceable to a useless record if the record does not include the facts the reviewer needs. “Explainable” can mean a thin explanation of the policy decision, not a full explanation of the model’s reasoning. A compliance officer should not let the vocabulary do the work.
The more defensible claim is modest. Policy as code can move policy from after-the-fact interpretation into pre-action control. It can make a proposed action fail before a deployment, a payment, or a data change takes effect. It can also create a record that shows what was asked and what was answered. Kyndryl says that with policy as code, agents’ decisions and actions are logged by design, creating audit trails for tracking behaviour.
That does not make the record sufficient. A record that says “allowed” is weak. A record that shows the proposed action, the relevant inputs, the policy applied, the result, and the review path is stronger. The gap between those records is where many governance claims become empty.
The useful scepticism comes from Kyndryl’s own limit. It says policy as code is one building block required for AI to scale, and that balanced human oversight remains crucial for successful AI deployment. Those statements should be read together. A policy engine can block an unsanctioned payment request. It cannot decide, by itself, whether the policy should allow a new class of payment request in the first place.
That is the better answer: agents turn policy into a runtime problem. If the agent can act, the organisation needs a control that acts before the agent does. Policy as code is one way to put that control into the path of the action rather than leaving it in a manual after-action review.
What this means if you have to produce evidence
Evidence changes the standard of proof. It is not enough to say that a policy existed. It is not enough to say that an agent was instructed. The hard question is whether the action that happened was checked against the policy that was in force for that action.
Kyndryl says policy as code creates operational logs that risk teams and regulators rely on. Treat that as a product claim, not as a regulatory safe harbour. The sentence does not say which regulator will accept which record. It does not remove the need to keep evidence in a form that your own audit, legal, and engineering teams can explain.
The evidence record should answer a plain sequence of questions. What did the agent try to do. What facts were supplied to the policy decision. Which rule decided the result. Was the result allow, block, or review. If review was required, what happened before the action took effect. These are not glamorous questions. They are the questions that survive an incident meeting.
The old application pattern often hides some of this because the user interface constrains the request. A refund page may require an amount, a customer, and a reason. An agent can produce a proposed refund through a less predictable path. The evidence burden therefore shifts from “which user clicked the button?” to “what action did the system permit, and on what basis?”
Policy as code helps only if the evidence is designed into the action path. If the policy decision happens in one place and the action happens somewhere else with no binding connection, a reviewer will find a gap. If the log keeps a general agent trace but not the policy decision, a reviewer will find another gap. If the policy decision records a result but not the action facts, the record may prove little more than that a system once said yes.
This is also where human review has to be specific. A generic “human in the loop” claim is too soft. The useful record says that a payment release needed approval because it matched a condition, that the approval happened before the release, and that the released payment matched the approved action. Kyndryl’s own statement that human oversight is crucial supports the need for review, but it does not specify the evidence format.
Teams that already run policy as code for software delivery have a head start. IBM describes automatic syntax checks and code review for a policy file when a pull request is triggered. That kind of discipline is relevant because policy itself becomes an artefact under review. The uncomfortable extension is that runtime decisions also become artefacts. A later dispute may ask not only whether the policy was reviewed, but whether the policy was applied to the right action.
Practical steps for applying policy as code to agents
- Start with actions. Do not begin with a broad statement such as “the agent must follow company policy.” Start with the action that can cause damage: release a payment, delete a record, change a credit limit, approve a supplier, or send a customer message. The rule should attach to the action, not to an abstract promise.
- Define the caller’s evidence. IBM’s pattern depends on the caller normalising data inputs before the policy engine runs policy code against them. For an agent, decide which facts must be supplied before the action can be judged. If the facts are not present, the policy should not pretend they are.
- Translate rules into machine-readable conditions. Kyndryl describes policy as code for agents as translating organisational rules, regulatory requirements, and operational controls into machine-readable code that restricts actions. Keep the translation narrow. A sentence in a policy manual may need several concrete tests before it can safely govern an agent action.
- Put the check before the effect. A policy decision is useful only if something enforces it before the payment is released or the record is changed. Kyndryl’s discussion of Policy Decision Points and Policy Enforcement Points frames the decision and enforcement split for whether an action should be allowed. If the agent can bypass that point, the policy is decoration.
- Design the denial path. IBM’s deployment example says a deny decision can stop a deployment until remediation. Agent actions need the same kind of explicit path. A blocked supplier approval should fail closed, route to review, or return for more evidence; it should not quietly continue through another route.
- Record the decision, not just the conversation. Kyndryl says policy as code logs agents’ decisions and actions by design. The record should show the proposed action, the decision, and the review path. A transcript alone is not the same thing as proof that a policy allowed the action.
- Test before blocking if the business cannot tolerate surprise. A team can run proposed policies beside production decisions before allowing them to stop work; Shadow Mode is the adjacent pattern to examine. Once review becomes part of the operating model, AI Decision Review Workflow is the next governance problem.
Crelis takes the runtime view: GREENLIGHT is described as checking sensitive actions before they reach systems, and the demonstration page asks where agents touch money, customers, records, or infrastructure.
Crelis is patent-pending. It holds no SOC 2, ISO 27001 or ISO 42001 certification, and claims none.
Related reading
- Shadow Mode — a way to test control decisions before they block live work.
- AI Decision Review Workflow — the review problem after an agent proposes an action.
- GREENLIGHT — the permission step for sensitive agent actions.
- Product demonstration — the route for seeing the action-control model in practice.
Want the full story?
Explore GREENLIGHT