Vikas Goyal

A primer on Microsoft Foundry agent controls, in public preview

Agent Controls

Let agents decide how to do the work. Let policy decide which actions they may take.

Agent controls is a managed policy service. Your agent host pauses at key moments, asks the service "may I?", and enforces the answer: allow, deny, or transform.

Built on the open-source Agent Control Spec (ACS) and Agent Hooks. Policies are a manifest plus Rego. Updated November 2026.

1The problem

Agents now act, and acting needs boundaries

A support agent can look up customers, process refunds and update accounts. It's told "no refunds over $100." A persuasive customer asks for $500. What actually stops the tool call?

System prompt

Describes the rule. Can't independently stop execution if the model emits the prohibited call anyway.

Content safety filter

Knows if text is harmful or sensitive. Doesn't know your financial limits, so a polite $500 refund passes.

Human approval on everything

Safe, but slow. It removes the efficiency and autonomy you deployed the agent for.

Runtime policy

An explicit, executable rule checked at the moment of action, outside the model. The agent stays free inside the boundary.

The shift: the goal isn't only safer agents. It's governable autonomy. Instead of scripting every step, you define the conditions under which an action is permitted.

2The stack

Four pieces, four jobs

Microsoft splits runtime governance into separate layers so it works across frameworks, models and clouds. The agent doesn't need to run in Foundry.

3Intervention points

Eight moments where the host can pause

Agent Hooks spans the full lifecycle. A policy manifest maps rules to the points your app actually calls. Pre-call points decide whether something may proceed; post-call points govern how a result may be used.

All eight can be bound in a manifest; the current preview evaluation API takes one event per request from four sources.

4Runtime flow

One evaluation, end to end

Division of labour: Agent Hooks decides when to check. ACS defines how policies are expressed and evaluated. Agent controls manages and hosts evaluation. The host enforces.

5Anatomy of a policy

Manifest picks the moment and the data. Rego decides.

A policy has two parts. The manifest (JSON, often authored in YAML) binds an intervention point to a Rego query, selects the target, declares tools and annotators. One or more Rego modules are uploaded as separate resources and hold the decision logic.

manifest.yaml

agent_control_specification_version: "0.4.0-alpha.1"
metadata:
  name: refund-guard
policies:
  refund-guard:
    type: rego
    query: data.refund_guard.verdict
intervention_points:
  pre_tool_call:
    policy_target: "$snap.tool_call.args"
    policy_target_kind: tool_args
    tool_name_from: "$snap.tool_call.name"
    policy: { id: refund-guard }
tools:
  refund_order:
    type: write
    security_labels: [financial_write]

policy.rego

package refund_guard
import rego.v1

default verdict := {
  "decision": "deny",
  "reason": "refund_not_permitted" }

verdict := {"decision": "allow"} if {
  input.intervention_point == "pre_tool_call"
  input.snapshot.tool_call.name == "refund_order"
  amount := input.policy_target.value.amount
  is_number(amount)
  amount > 0
  amount <= 100
}
Names to keep apart: the Azure resources (raiPolicies/refund-guard-v1, raiRegos/refund-guard-v1), the manifest's logical policy ID (refund-guard), and the Rego query (data.refund_guard.verdict).

6Try it

Refund guard simulator

This mimics the documented refund policy locally in your browser, so you can see how the default-deny Rego behaves. It doesn't call Azure.

$75
Policy allows amounts greater than 0 and no more than 100.

    
Response allowed · allow Host dispatches refund_order with the evaluated arguments.

    

7Verdicts

Three decisions, one contract

allow

Run the action or release the content exactly as evaluated.

deny

Block the action or withhold the content. May carry an approval request for your own review workflow; it stays blocked until that workflow approves.

transform

The service already applied the change (e.g. redacting a field). Validate and use the returned content; don't apply it again. Not supported on the LLM-judge path.

// HTTP 200 means evaluation completed, not that the action is allowed
{
  "verdict": "blocked",
  "reason": "refund_not_permitted",
  "acsVerdict": { "decision": "deny", "reason": "refund_not_permitted",
                  "message": "...", "warnings": [], "approval": null }
}
Check both verdict (allowed / blocked) and acsVerdict.decision. Warnings add information without changing the decision.

8Annotators in practice

Mix deterministic rules with judgment

Rego only

Exact conditions: thresholds, approved-tool lists, argument shapes.

Built-in classifiers

Jailbreak, indirect prompt injection, harms (severity 0–7), protected material, task adherence, groundedness, PII where enabled.

LLM judges

Business rubrics, e.g. "is this reply a definite refund promise?" Returns informational / commitment / uncertain plus a score.

Combined

A third Rego module requires both the classifier policy and judge policy to allow before output is released.

LLM judges run on your Azure OpenAI deployment. The serving Content Safety account's managed identity needs Cognitive Services OpenAI User on the model account. Judge timeouts, refusals or malformed output keep the action blocked.

9Choosing a mode

Open-source ACS vs hosted agent controls

CapabilityOpen-source, in-process ACSHosted agent controls
Policy languageACS manifest + RegoACS manifest + Rego
Where evaluation runsOpen-source SDK in your appMicrosoft-managed service
Publishing and updatesYour files or custom infraShared ARM policy + Rego resources
ObservationsAnnotators you configureContent Safety classifiers + enabled LLM judges
Reuse across appsCustom distributionReference central policies by ID
Interception and enforcementAgent hostAgent host

They're complementary: use open-source for local development and app integration, and the hosted service for shared enterprise policies across hundreds of agents and teams.

10APIs and setup

Control plane to author, data plane to evaluate

Prerequisites

An Azure AI Content Safety resource in a region enabled for the preview. Creating the resource alone doesn't enable agent controls.

Limits (preview)

content ≈ 10,000 chars. Manifest up to 256 KiB, Rego 512 KiB, ARM body 1 MiB. Some deployments enforce 48 KiB / 200 KiB.

Rollout

Publish a new named version (refund-guard-v2), test, then switch the app's policyId. In-place updates need If-Match ETags.

Billing (preview)

You pay only for Content Safety classifier usage and LLM-judge model usage triggered by evaluation.

11The enforcement boundary

What the service does not do

Not a sandbox

It doesn't run your agent, execute tools, or control any path that bypasses your interception code.

Not authorization

Agent IDs, session IDs and identity claims in the request don't grant access. Keep permissions and business data in trusted systems.

Not automatic coverage

Binding a point in a manifest doesn't add interception to your app. Unchecked points are unprotected.

Host rules that make it work
  • Evaluate what you execute. Capture arguments once; use the same value for evaluation and dispatch.
  • Fail closed. Timeouts, 429/5xx, malformed or inconsistent responses all keep the action blocked.
  • Don't retry a deny hoping it becomes an allow, and don't reuse an old allow for changed arguments.
  • Buffer streamed output and evaluate the complete text before releasing tokens; a later deny can't recall what's already shown.
  • Monitor for zero protected dispatches after a deny or error, and log correlation IDs, not raw prompts or arguments.

12Next steps

Where to go from here

  • Run the quickstart: create the refund policy, then evaluate $75 (allowed) and $150 (blocked).
  • Write a manifest per agent that names every intervention point the host really calls.
  • Start with deterministic Rego for money and data movement, then layer classifiers and a judge on output.
  • Wire deny + approval into your existing review process before relying on it.

Sources. Agent controls is a preview service; versions and limits may change.