Enterprise reference design

Governed agent execution with bounded tools and durable approval

A private Azure agent platform that separates planning from execution, binds approval to an exact action and reconciles retries before repeating side effects.

Enterprise architectsAgent platform engineersApplication security teamsOperations and business owners

The enterprise use case

Design for the actual operating context.

An enterprise assistant proposes changes to business systems, but each consequential action must pass deterministic policy, any required human approval, backend authorization and duplicate-safe execution.

Required outcomes

  • Give the planning agent no direct write authority to business systems.
  • Bind approval to the exact target, parameters, policy version and expiry.
  • Recover queued actions without treating broker deduplication as exactly-once business execution.
  • Preserve useful evidence without collecting unrestricted prompts or credentials.

Enterprise architecture

Explore the design, one view at a time.

Keep planning separate from model authority

A private application request reaches a bounded planner; a separate gateway API controls inference.

Governed enterprise agent platform — Keep planning separate from model authorityA private application request reaches a bounded planner; a separate gateway API controls inference.. Official Microsoft service icons; explicit resource and network boundaries. Green numbered steps match the F-numbered flow register below the diagram. Governed enterprise agent platform Keep planning separate from model authority A private application request reaches a bounded planner; a separate gateway API controls inference. Enterprise Approved corporate connectivity Application subscription Managed application and model services Application spoke VNet Dedicated network attachments; service identities remain separate F1: Private API request. The client reaches the APIM private endpoint through corporate connectivity and sends a token for the target application API. F3: Validated application call. The gateway validates the application request; the planner validates again and has no direct backend-write or queue-publish authority. F4: Model-gateway request. The planner uses its workload identity on the distinct model API. Gateway policies fix the model backend and enforce usage budgets. F5: Inference identity. The model API obtains a resource-specific token using a narrowly scoped APIM identity and sends it only to the configured inference backend. Enterprise client. Application API audience Enterprise client Application API audience API Management. Private app and model APIs API Management Private app and model APIs Planning service. No business-write authority Planning service No business-write authority Azure OpenAI. Approved inference backend Azure OpenAI Approved inference backend Private endpoints. APIM and managed services Private endpoints APIM and managed services APIM integration. Dedicated delegated subnet APIM integration Dedicated delegated subnet Container Apps subnet. Internal environment Container Apps subnet Internal environment Private API request 1 Validated application call 3 Model-gateway request 4 Inference identity 5 Network attachments are explicit Private endpoints, APIM outbound integration and the internal Container Apps environment support the selected paths. Managed services are outside the drawn VNet. Model output grants no authority The planner cannot publish execution messages or write to business systems. Inference credentials are not business API credentials. Reference design · Microsoft product icons used under Microsoft’s published terms · Numbered steps refer to the accompanying flow register
7 components · 4 numbered connections

Green step numbers match the F-numbered flow register below. Solid boundaries show ownership; dashed blue boundaries show networks. Logical groups are labeled explicitly. Microsoft service icons identify the components.

Authorize one immutable business action

A reviewer approves the exact target, parameters and effect; the stored decision is bound to a hash and expiry.

Governed enterprise agent platform — Authorize one immutable business actionA reviewer approves the exact target, parameters and effect; the stored decision is bound to a hash and expiry.. Official Microsoft service icons; explicit resource and network boundaries. Green numbered steps match the F-numbered flow register below the diagram. Governed enterprise agent platform Authorize one immutable business action A reviewer approves the exact target, parameters and effect; the stored decision is bound to a hash and expiry. Enterprise Application user Microsoft Entra tenant Identity authority outside the application VNet Reviewer Independent approval authority Application subscription Distinct planner and policy-service identities F2: User token. Entra issues a token with the intended audience and delegated scope. The service route to Entra is separate from private application ingress. F6: Proposed exact action. The planner submits typed parameters and an exact resource target. The policy service evaluates schema, resource preconditions and business constraints. F7: Independent approval. An independently authorized reviewer approves the canonical target, effect and parameters through the private application route; approval is bound to hash and expiry. F8: Decision and outbox. The approval service atomically stores the immutable authorization record and an outbox entry. A later action change requires a new decision. Enterprise client. User authentication Enterprise client User authentication Microsoft Entra ID. Audience and delegated scope Microsoft Entra ID Audience and delegated scope Authorized reviewer. Exact action and effect Authorized reviewer Exact action and effect Planning service. Typed proposal only Planning service Typed proposal only Policy and approval. Hash, target and expiry Policy and approval Hash, target and expiry Azure SQL ledger. Atomic decision and outbox Azure SQL ledger Atomic decision and outbox User token 2 Proposed exact action 6 Independent approval 7 Decision and outbox 8 Approval is not editable intent A later target or parameter change requires a new decision. Expiry and resource preconditions are checked again before execution. Delayed work needs its own contract Use a constrained application identity with server-validated approval context, or obtain fresh delegated authorization. Never enqueue reusable user tokens. Reference design · Microsoft product icons used under Microsoft’s published terms · Numbered steps refer to the accompanying flow register
6 components · 4 numbered connections

Green step numbers match the F-numbered flow register below. Solid boundaries show ownership; dashed blue boundaries show networks. Logical groups are labeled explicitly. Microsoft service icons identify the components.

Reconcile effects at the business boundary

The queue can redeliver; durable receipts and reconciliation control repeated and uncertain business effects.

Governed enterprise agent platform — Reconcile effects at the business boundaryThe queue can redeliver; durable receipts and reconciliation control repeated and uncertain business effects.. Official Microsoft service icons; explicit resource and network boundaries. Green numbered steps match the F-numbered flow register below the diagram. Governed enterprise agent platform Reconcile effects at the business boundary The queue can redeliver; durable receipts and reconciliation control repeated and uncertain business effects. Operators Recovery decision authority Application subscription Private managed services; execution, evidence and recovery paths F9: Eligible outbox item. The dispatcher reads committed outbox entries, sends compact immutable references, and records delivery progress without inventing approval. F10: Stable message ID. The queue sender uses a stable action identifier and retries uncertain sends. Duplicate detection is limited to its configured history window. F11: PeekLock delivery. At-least-once delivery may repeat. The worker fetches authoritative state, verifies approval and expiry, and reserves execution through the ledger. F12: Authorized tool call. The worker calls a fixed tool route with its own backend-audience token; the gateway must not replace the business authorization with model authority. F13: Bounded business effect. The tool API forwards the token only to its intended backend. The backend enforces app role, target scope and an idempotency or reconciliation contract. F14: Durable outcome receipt. The worker records outcomes and reconciles uncertain backend results by stable key before retrying. Message completion follows durable outcome recording. F15: Execution evidence. Representative event path: action ID, approval hash, policy version, timings and result class. Other services emit correlated signals without raw conversations or tokens. F16: Restore with fencing. Operations restores tested SQL state and fences previous workers, then reconciles with backend receipts; old approval records must not replay completed effects. Azure SQL ledger. Approval, outbox and receipts Azure SQL ledger Approval, outbox and receipts Outbox dispatcher. Queue-sender identity Outbox dispatcher Queue-sender identity Service Bus Premium. Private queue and DLQ Service Bus Premium Private queue and DLQ Execution worker. Recheck approval and expiry Execution worker Recheck approval and expiry API Management. Fixed tool route API Management Fixed tool route Business API. Authorization and idempotency Business API Authorization and idempotency Azure Monitor. Safe execution evidence Azure Monitor Safe execution evidence Recovery operators. Fence previous workers Recovery operators Fence previous workers Eligible outbox item 9 Stable message ID 10 PeekLock delivery 11 Authorized tool call 12 Bounded business effect 13 Durable outcome receipt 14 Execution evidence 15 Restore with fencing 16 At-least-once delivery remains Reserve execution in the ledger, reconcile unknown backend effects by stable key, then record the durable result before completing the message. Recovery must fence and reconcile Restore tested SQL state, fence old workers, compare backend receipts and revalidate approvals before replaying queued or dead-lettered work. Reference design · Microsoft product icons used under Microsoft’s published terms · Numbered steps refer to the accompanying flow register
8 components · 8 numbered connections

Green step numbers match the F-numbered flow register below. Solid boundaries show ownership; dashed blue boundaries show networks. Logical groups are labeled explicitly. Microsoft service icons identify the components.

Follow the numbered connections

Flow register

Paths shown in the diagram have the following scope.

FlowFrom → toPurpose and control
F1TrafficEnterprise application client API ManagementPrivate API request

The client reaches the APIM private endpoint through corporate connectivity and sends a token for the target application API.

F2Identity & controlEnterprise application client Microsoft Entra IDUser authentication

Entra issues a token with the intended audience and delegated scope. The service route to Entra is separate from private application ingress.

F3TrafficAPI Management Container App: plannerBounded planning

The gateway validates the application request; the planner validates again and has no direct backend-write or queue-publish authority.

F4TrafficContainer App: planner API ManagementModel-gateway call

The planner uses its workload identity on the distinct model API. Gateway policies fix the model backend and enforce usage budgets.

F5TrafficAPI Management Azure OpenAIInference only

The model API obtains a resource-specific token using a narrowly scoped APIM identity and sends it only to the configured inference backend.

F6TrafficContainer App: planner Container App: policy / approvalProposed action

The planner submits typed parameters and an exact resource target. The policy service evaluates schema, resource preconditions and business constraints.

F7Identity & controlAuthorized reviewer Container App: policy / approvalExact-action review

An independently authorized reviewer approves the canonical target, effect and parameters through the private application route; approval is bound to hash and expiry.

F8TrafficContainer App: policy / approval Azure SQL action ledgerDecision + outbox

The approval service atomically stores the immutable authorization record and an outbox entry. A later action change requires a new decision.

F9TrafficAzure SQL action ledger Container App: dispatcherEligible outbox item

The dispatcher reads committed outbox entries, sends compact immutable references, and records delivery progress without inventing approval.

F10TrafficContainer App: dispatcher Service Bus PremiumStable message ID

The queue sender uses a stable action identifier and retries uncertain sends. Duplicate detection is limited to its configured history window.

F11TrafficService Bus Premium Container App: executorPeekLock delivery

At-least-once delivery may repeat. The worker fetches authoritative state, verifies approval and expiry, and reserves execution through the ledger.

F12TrafficContainer App: executor API ManagementAuthorized tool call

The worker calls a fixed tool route with its own backend-audience token; the gateway must not replace the business authorization with model authority.

F13TrafficAPI Management App Service: business APIBounded business effect

The tool API forwards the token only to its intended backend. The backend enforces app role, target scope and an idempotency or reconciliation contract.

F14RecoveryContainer App: executor Azure SQL action ledgerReceipt / reconciliation

The worker records outcomes and reconciles uncertain backend results by stable key before retrying. Message completion follows durable outcome recording.

F15MonitoringContainer App: executor Monitor / Application InsightsSafe execution evidence

Representative event path: action ID, approval hash, policy version, timings and result class. Other services emit correlated signals without raw conversations or tokens.

F16RecoveryAzure SQL action ledger Recovery operatorsRestore with fencing

Operations restores tested SQL state and fences previous workers, then reconciles with backend receipts; old approval records must not replay completed effects.

Assumptions to confirm

  • A single organizational tenant and an approved landing zone provide private connectivity and DNS.
  • Customer-managed Container Apps host the orchestrator and execution services; managed Foundry Agent Service is an optional redesign.
  • Backends expose narrow Entra-protected APIs with stable object identifiers and an idempotency or reconciliation contract.
  • High-impact actions require an authorized reviewer independent of the planning agent.
  • Service Bus Premium and private endpoints are accepted fixed-cost components; recovery capacity is budgeted separately.

This design treats model output as a proposed action, never as execution authority. Separate services validate, approve, dispatch and execute changes. It is a documentation-reviewed reference architecture, not a deployed implementation or a promise that every Microsoft agent product supplies these controls automatically.

The three views separate planning and inference, authorization and approval, and execution and recovery. Together they retain links F1-F16. Supporting network services apply to the corresponding private paths.

Concrete service selection and trust boundaries

Deploy customer-managed services into an internal Azure Container Apps workload-profile environment connected to the application spoke. Use APIM Standard v2 with a private gateway endpoint and outbound VNet integration. The model gateway and application APIs can share that APIM instance initially, but use separate API policies and identities; separate instances provide stronger administrative isolation.

Component Deployment choice Authority deliberately withheld
Orchestrator Container App, bounded model/tool iterations No business write credential and no direct queue-send role.
Tool and model gateway Private APIM APIs with fixed backend mappings No caller-selected destination, audience or arbitrary forwarding URL.
Approval/policy service Separate Container App and managed identity Cannot silently change an already approved action.
Durable state Azure SQL Database General Purpose, private endpoint Planning identity cannot approve or alter execution status.
Outbox dispatcher Container App with queue-sender identity Does not invent actions or grant approval.
Execution worker Separate Container App, ingress disabled Can call only the assigned narrow backend operations.
Messaging Service Bus Premium, private endpoint, queue and DLQ A message’s presence does not confer business authorization.
Business API Private Entra-protected App Service API Rechecks target, operation and caller rights.
Supporting services Key Vault, ACR Premium, DNS, Firewall, Monitor Each has separate administrative and runtime permissions.

Private Link for Service Bus requires Premium. Container Apps workload-profile environments support the selected egress routing features; legacy Consumption-only environments differ. Internal environments use a private load-balancer address. Configure application ingress to permit the required VNet clients without confusing environment-private ingress with access restricted to sibling apps only. Messaging tier, Container Apps network model.

Numbered planning and identity flow

  1. The enterprise client authenticates through Entra and calls the private APIM application API with a token for the intended backend. Validate tenant, audience, authorized client and required claims. The backend validates the token again; a trusted gateway address is not user authorization.
  2. APIM sends the bounded request to the orchestrator. The orchestrator loads the approved tool catalog and schema version. Disable tools outside the assigned business workflow, and reject unknown fields, unbounded selectors and model-supplied network locations.
  3. The orchestrator calls the model through a separate APIM API using its workload identity. That API applies usage limits and uses a narrowly scoped gateway identity for inference. It must not forward an inference token to a caller-selected destination.
  4. A tool response or retrieved document remains untrusted data. The orchestrator may propose an action, but only the policy service can turn that proposal into an eligible execution record.

APIM provides Entra token validation and managed-identity authentication to backends. Its managed-identity policy replaces the authorization header with a resource-specific token; policy authors can exercise that identity’s privileges. Restrict policy editing and review backend mappings as privileged configuration. Token validation, identity-policy limits.

Assign different managed identities to the orchestrator, approval service, dispatcher and executor. Prefer direct resource role assignments over a shared broadly privileged identity, and keep deployment permissions separate. Container Apps supports managed identities and managed-identity-based scale rules; configure the scaler separately from the worker’s application permissions. Runtime identities.

Use delegated OBO only when a backend must enforce the initiating user’s rights and the token lifecycle supports that interaction. For delayed work, choose a documented app-only authorization contract with server-validated approval context, or require fresh user authorization; do not place reusable user tokens in messages. OBO is for user delegation, not exchanging app-only identities. OBO scope.

Approval is an immutable action record

Our proposed record binds tenant, requesting user, tool version, operation, exact resource ID, canonical parameters, expected resource version, maximum effect, cost budget, expiry, policy version and idempotency key. Store a canonical action hash with the approval. A later parameter change creates a new proposal and invalidates the old approval.

The reviewer sees the target and effect in business terms, including the exact recipient, amount, object or permission change where relevant. The service checks reviewer authority and separation of duties; a natural-language statement that a manager approved is not evidence. Require fresh approval after expiry, material policy changes or changes to the resource precondition.

Low-impact operations may follow a deterministic preapproved policy, but record that policy decision explicitly. Do not label it human approval. Bound read tools too: unrestricted bulk export can have consequences even when no database row is modified.

Numbered dispatch and execution flow

  1. The approval service atomically writes the eligible action and an outbox record in Azure SQL. The outbox closes the gap between accepting an approval and attempting message publication; it does not create a distributed transaction with the backend.
  2. The dispatcher sends a compact reference and immutable action hash to Service Bus, using a stable message ID. It records dispatch progress and safely retries uncertain sends. Do not include secrets or the entire conversation.
  3. The worker receives with PeekLock, reads authoritative state, and rechecks expiry, policy, resource version, approval and execution status. Reject discrepancies even when the queue message is well formed.
  4. The worker calls a fixed private APIM tool route with its own token for the backend audience. APIM forwards that token only to the intended backend, which validates the identity, constrained app role and resource-level authorization. The backend also consumes the stable idempotency key or exposes a reliable status lookup.
  5. Commit the outcome and receipt to the ledger, then complete the message. If the backend may have succeeded but the response was lost, mark the action uncertain and reconcile by key. Never blindly repeat a consequential action whose outcome is unknown.

Service Bus PeekLock provides at-least-once delivery, so retries and lock loss can repeat processing. Duplicate detection filters repeated message IDs within its configured history window; it does not make a database update, payment or permission change happen exactly once. Delivery semantics, duplicate-detection boundary.

For a backend without idempotency or reliable reconciliation, require an explicit manual recovery path before enabling automated writes. Limit retry count and duration, use backoff, and stop retries after approval expiry. Dead-lettered actions require operator triage and fresh authorization checks before replay. DLQs are not automatically cleaned up, and their messages do not observe normal TTL expiration. DLQ behavior.

Private connectivity does not make tools trustworthy

Keep APIM, SQL, Service Bus, Key Vault, registry and model data paths private where supported. ACR private endpoints require Premium; private registry builds and image pulls need their own DNS and network path. Registry requirements. Disable public data access explicitly. Resolve the correct service names from the runtime, dispatcher, worker and private build runner. Enforce fixed destinations and redirect handling in application code; a permitted hostname does not authorize arbitrary operations or data upload.

Route supported Container Apps outbound traffic through the hub firewall and allow required platform dependencies deliberately. Use separate subnets for services requiring exclusive delegation. A NAT address is an egress identity, not a destination policy. Container Apps firewall integration.

Foundry Agent Service is an alternative execution host, not an assumed component here. Its public, BYO-VNet and managed-network options have different inbound/outbound behavior and tool dependencies. Reassess session isolation, tool reachability and data stores before substitution; an inbound private endpoint alone does not establish a private outbound tool path. Foundry networking choices.

Numbered telemetry and recovery flow

  1. Emit a correlation ID across gateway, proposal, approval, outbox, broker delivery and backend receipt. Record policy decisions, approval hashes, tool versions, result classes, latency and usage. Do not export access tokens, full prompts, confidential parameters or raw tool results by default.
  2. Send filtered spans to Application Insights and operational signals to Monitor/Log Analytics. Alert on approval mismatches, unexpected tool destinations, repeated lock loss, growing DLQ age, stuck outbox items and uncertain outcomes. Test filtering before export; ingestion transformations occur after collection. Telemetry controls.
  3. On incident declaration, stop new dispatch and fence old workers before restoring state. Preserve the ledger and backend receipts. Resume only after reconciling uncertain actions; restoring an older database must not authorize replay of already completed business effects.
  4. Test SQL point-in-time restore within the configured retention policy. For regional resilience, choose and qualify geo-capable backup/replication settings explicitly. Service Bus Geo-Replication copies message data and metadata; metadata Geo-Disaster Recovery does not copy queued messages. Promotion and private endpoint/DNS readiness need an owned runbook. SQL recovery, Service Bus regional options.

A model outage should stop new planning safely, without changing approved tool parameters or switching to an unapproved model. Qualify the recovery deployment, version, processing geography and quota before an incident. Bound retry budgets and honor throttling; regional model capacity is a separate dependency from restoring SQL or the queue. Model deployment choices.

Acceptance, rollout and cost ownership

Test Required result
Prompt requests an unregistered tool No network call or write capability is issued.
Parameters change after approval Hash/precondition mismatch blocks execution.
Worker crashes after backend success Reconciliation finds the original result without repeating the effect.
Expired action returns from DLQ Replay is blocked pending a new valid decision.
Wrong tenant, audience or backend role Authorization fails at gateway and backend.
Primary-region recovery Previous workers are fenced; restored ledger reconciles with backend receipts.
Sensitive synthetic input Routine logs contain approved metadata only.

Begin with read-only tools, then synthetic writes, then one reversible business action. The business owner defines approval thresholds and compensation; the application team owns idempotency and policy; the platform team owns identities, networking and release controls; operations owns uncertain outcomes and replay. Do not expand tool scope until these responsibilities have staffed escalation paths.

Budget for APIM and Service Bus Premium’s capacity floor, Container Apps minimum replicas, SQL compute and backups, ACR Premium, private endpoints, firewall/DNS, model usage and retained evidence. Queue-based scale-out can reduce idle worker cost but must not exceed backend throughput or reviewer capacity. Regional standby and long retention add cost. Set per-workflow budgets and measure failure/retry costs alongside successful actions before choosing reserved capacity.

Trace the design decisions

Microsoft architecture & product guidance

  1. Microsoft Learn - Container Apps networking ↗
  2. Microsoft Learn - Container Apps managed identities ↗
  3. Microsoft Learn - Container Apps firewall integration ↗
  4. Microsoft Learn - API Management private endpoints ↗
  5. Microsoft Learn - API Management Entra token validation ↗
  6. Microsoft Learn - API Management managed-identity policy ↗
  7. Microsoft Learn - Entra on-behalf-of flow ↗
  8. Microsoft Learn - Service Bus Premium ↗
  9. Microsoft Learn - Service Bus message loss and duplicate processing ↗
  10. Microsoft Learn - Service Bus duplicate detection ↗
  11. Microsoft Learn - Service Bus dead-letter queues ↗
  12. Microsoft Learn - Service Bus geo-replication ↗
  13. Microsoft Learn - Azure SQL automated backups ↗
  14. Microsoft Learn - Foundry Agent Service networking options ↗
  15. Microsoft Learn - Filter OpenTelemetry ↗
  16. Microsoft Learn - ACR private endpoints ↗
  17. Microsoft Learn - Model deployment types ↗

Inspect operational evidence

Supporting Sentinel queries

These are contextual hunting starters, not end-to-end validation of the architecture. Check each query's source tables, collection scope and limitations.

Query library →