Download audio: https://op3.dev/e/dts.podtrac.com/redirect.mp3/developers.podcast.go-aws.com/media/230.mp3
Rocky Lhotka has created RockBot - an agent and a framework for building agents.
He talks about how he built this tool using LLMs and MCP servers, and how he uses RockBot to make his life easier.
When the only developer on a VB6 project passed away, the business owner reached out to Kevin Griffin for help maintaining the project.
With no source control or documentation, Kevin turned to Claude AI tools to help him understand the code base and manage support tickets. Kevin explains how AI helped him find and unders tand the latest source code and troubleshoot issues with an unfamiliar environment.
Imagine an AI agent that handles customer credit requests. Over a year, the business tunes its approval rules, raises the agent's authority step by step, builds a test set from real cases and records thousands of decisions. Then the model is retired, or a better agent comes along. What has to change: only the agent, or also the rules, the approvals, the tests and the decision history?
For many agents built today, it is the second. They are built into one workflow, one orchestrator or one platform engine. That works for a pilot. But when rules live in prompts, approval is something the agent does and history sits in framework memory, a new agent means rebuilding part of the process. That is a separation problem more than an orchestration problem.
The rules, test cases and human corrections that grow around an agent capture how your organization decides and works. That institutional learning is an asset whose value should not depend on one model, framework or provider (sovereignty). This article proposes five architectural invariants that keep it when the agent changes, a composition I call Contract-Driven Agentic Architecture (CDAA), and one way to build it on Azure.
Building an agent has become quick. Embedding it in a process that already exists has not. That process has a system of record, approvals, service levels and an audit trail. The agent brings a model, a prompt, tools and a framework, each with its own release cycle. Agents usually end up in one of three places (Figure 1). None is wrong in itself, but each can lead to the same three problems.
Figure 1. Three common ways to embed an agent, each holding part of the business logic.
So I start from one requirement: every agent or model must be replaceable without losing the business logic, the contract terms, the history and the evaluation. If any of them lives inside the agent, the agent is not replaceable. It can only be rebuilt.
|
Must survive a replacement |
Where it often lives today |
Where CDAA keeps it |
|
Business logic |
Prompts, agent code, orchestrator graphs |
The process, and rules outside every agent |
|
Contract terms |
Implicit in prompts and tool definitions |
A versioned contract per capability |
|
History |
Agent threads and framework logs |
An evidence store, keyed by process instance and contract version |
|
Evaluation |
Test sets tuned to one agent and one model |
One suite per contract, run against any implementation |
CDAA rests on one idea: the contract, not the agent, is the unit of design and replacement. A contract describes a business capability, such as "propose a credit for a late delivery": what goes in and out, what may be used and proposed, and how results are judged. Any implementation that meets it can do the work: a vendor agent, an in-house agent, a rules component or a person. The agent decides how to do the task. The business decides what may happen, keeps the process state and carries out the transaction (Figure 2).
Each established pattern solves part of the problem. Agent as a service, for example through A2A [2], agent as a worker and agent as a tool give a stable interface. Bounded autonomy [3] and human in the loop [4] add limits and accountability. In supervisor and worker, a manager agent delegates, and in evaluator and optimizer, one agent checks another's work [4]. Event-driven agents [5], an agent gateway [6] and durable execution [7] add loose coupling, controlled access and recovery. What they can leave open is where the rules, the authority and the history live when the agent itself changes.
Two recent posts on this blog make related points: Jiri Binko proposes "AI reasons; authorized services act; governed data measures what happened" [8], and Dominik Zemp keeps authority outside the model and lets agents earn autonomy through evaluation [9]. I agree with both. The closest prior work I found is an individual Internet-Draft, the Agent Action Decision Protocol (AADP). It separates per-action authorization from agent identity and specifies approvals, idempotency and decision evidence [10]. Research on agent contracts formalizes resource and time bounds [11] and behavioral contracts enforced at runtime [12].
None of the building blocks is new. CDAA combines them around a different goal: keeping a business capability, and what the organization learned around it, independent of the AI that does the work. The result is a property you can test: add, replace or remove an implementation without changing rules, routes or decision records. Orchestration decides how agents work together. CDAA decides how they take part in a governed business process, so it complements orchestration.
Patterns describe what to build. Invariants describe what must stay true while everything around them changes: the model, the framework, the provider, and even whether a program or a person does the work. I use five, each with a test you can run.
Any conforming agent, deterministic component or human participant can fulfill the same contract.
A replacement does not need to give the same answers as the agent before it. Two good agents can give different answers that are both right. Instead, it must meet the same contract at four levels. That is behavioral substitutability.
|
Compatibility |
What the replacement must keep |
|
Syntactic |
The input and output schemas |
|
Semantic |
The meaning of inputs, outputs and proposed actions |
|
Behavioral |
The acceptance criteria on the contract's evaluation suite |
|
Operational |
The agreed security, latency, availability and cost limits |
The idea goes back to the Liskov substitution principle [13], but for agents, Microsoft's orchestration guidance recommends scoring output against criteria rather than exact matches [4]. Replaceability is also your exit plan when a model is retired or a provider no longer fits. Test: bind a second implementation to one contract and run its suite. Nothing in the business architecture should change.
Agents independently determine how to fulfill a task within explicitly defined boundaries.
Inside the boundary, the agent plans, chooses tools and reasons freely. The boundary is enforced outside the agent: by its identity, by the gateway in front of its models and tools, and by network rules that make the gateway the only route. A prompt cannot widen it. Test: ask an agent to call a tool outside its contract, then call that tool directly. Both calls should fail, whatever the model decides.
Agents cannot grant themselves permissions or bypass business authorization.
No agent holds a write credential to a system of record. A separate policy decision point answers allow, escalate or deny for every consequential action, and a separate executor carries out what is allowed. The rules look at the capability, the action, the level and the facts. They never name an agent. The agent's identity proves who is calling and which contract it is bound to. Nothing the agent supplies counts as a fact. Test: search the rules for implementation names, and try to write with an agent's identity. The search should find nothing, and the write should fail.
Every consequential decision and action produces attributable, correlated evidence.
Each step writes a record with one correlation ID: which implementation proposed what, on which facts or fact versions, under which contract and policy versions, what was decided and what happened. A log tells you what a component did. Evidence tells you why the business let it happen. Learning is what the business changes as a result: a rule, a limit or a test case. Keep personal data to a minimum, and set retention before you make records immutable. Test: rebuild the full chain of one action from last week from the evidence store alone, without replaying the agent's reasoning.
Business process state, rules and outcomes remain independent of agent implementations and AI providers.
The process keeps its state in its own system of record or durable workflow, or runs as a choreography of typed events. It needs no central agent orchestrator. Known routes stay in deterministic code, not in a model, as Microsoft's guidance advises [4]. Agents exchange typed, versioned messages, and a message is a report, never an instruction, which narrows the inter-agent risk that OWASP lists as ASI07 [14]. Sovereignty then covers how the business decides and learns, not only its infrastructure, data and models. Test: switch an agent off. The process should route its work to the contract's fallback and keep its state.
Invariants 02 and 03 rest on the most important principle in the design. Autonomy is what an agent may work out and propose. Authority is what it may actually make happen. The two belong to different owners.
|
Responsibility |
Owner |
|
Define business objectives |
Business process |
|
Determine how to solve a task |
AI agent |
|
Select permitted tools |
AI agent, within policy |
|
Propose a business action |
AI agent |
|
Authorize a business action |
Policy decision point |
|
Execute a business transaction |
Executor |
|
Validate the outcome |
Independent evaluator or business process |
|
Maintain business process state |
Business process runtime |
An agent can have significant reasoning autonomy without significant operational authority. That is what most business processes need: let the agent think freely, and let something else decide what happens. Aleksey Lekontsev makes a related argument: coordination and authority are separate design decisions [15].
The contract sets the boundary, including the highest level the capability can ever reach (Figure 3). The policy registry sets how much of that the business delegates today: a level of delegated authority, not of autonomy. Raising it does not change how the agent reasons, only which of its proposals run without a person. The three levels below are my own classification, not a standard: AADP defines per-action tiers [10], and Feng and colleagues describe a broader scale [3].
A new implementation can also run in shadow mode, with no authority at all (section 5).
The level is data, not code. Teams often build autonomy levels into the prompt, tools or workflow, so a change needs a release. Here the policy decision point reads the level at decision time, like any other fact. Raising a level is a reviewed change backed by evaluation results. Lowering a level or revoking a binding takes effect at once, even for decisions that have not run yet (section 6). Reversing an action that already ran is a business step, such as canceling the credit. No agent can change its own level.
In Rego for Open Policy Agent (OPA), the credit rule can be this short:
package credit.decision import rego.v1 default decision := "deny" decision := "deny" if { not valid_input } else := "deny" if { input.proposal.amount > input.facts.eligible_amount } else := "allow" if { input.level == 3 input.facts.open_dispute == false is_number(data.limits.issue_credit.max_amount) input.proposal.amount <= data.limits.issue_credit.max_amount } else := "escalate" if { input.level >= 2 } valid_input if { input.capability == "customer_credit" input.proposal.action == "issue_credit" input.level in {1, 2, 3} is_number(input.proposal.amount) input.proposal.amount > 0 is_boolean(input.facts.open_dispute) is_number(input.facts.eligible_amount) }The rule has three answers.
|
Answer |
When |
What happens next |
|
Allow |
L3, no open dispute, and the amount within both the limit and what the customer is eligible for |
The executor acts |
|
Escalate |
The proposal is valid, but at L2, above the limit, with an open dispute, or with a missing or mistyped limit |
A person decides |
|
Deny |
Missing or mistyped input, an amount above what the customer is eligible for, or a proposal at L1 |
The case goes to the contract's fallback |
Before the rule runs, the policy decision point checks who is calling, that the proposal is for the order in the task, and the contract's highest level. Then it adds the current level from the registry and the facts from the systems of record. OPA's own example for agent tool calls judges the request itself: the tool and its parameters [16]. Here, facts never come from the request, so injected text cannot change them.
Take the customer credit capability. A vendor agent is bound to it at L3, and the business wants an in-house agent instead. This is the contract both must meet:
contract: customer_credit version: 2.1.0 owner: Customer service operations capability: Propose a goodwill credit for a late delivery input: CreditRequest v2 # order, customer, reason output: CreditProposal v2 # action, amount, order, rationale actions: [issue_credit] tools: [orders.read, customers.read, credit-policy.read] never_decide: [account closure, legal claims] evidence: [process_id, idempotency_key, implementation, model, proposal, facts, decision, versions, outcome] evaluation: suite: suites/customer-credit/v2 accept: {correct_outcome: ">= 95%", rule_breaches: 0, p95_seconds: "<= 20"} fallback: credit-desk queue max_level: L3The swap takes four steps.
Shadow mode cannot issue a credit. Its identity has read-only scopes, the policy decision point accepts proposals only from the active binding, and the executor writes once per idempotency key.
The new agent's deployment, identity, binding and starting level change. The business architecture stays (Figure 4): rules, boundaries, process state and routes, decision history, acceptance criteria, the executor and, if the new agent conforms, the contract.
The swap only works if the learning survives it. Keep the test cases, acceptance criteria and evaluator definitions (rubrics, grading prompts and code checks) in Git with the contract, in formats any evaluation tool can read. If a model grades the output, pin that judge model and re-baseline when it changes. Every human override becomes a candidate test case for the next implementation. Agents can propose changes to rules or contracts, but only an owner's review makes them. Agent memory is a replaceable cache, never the only copy of anything the business needs.
CDAA needs no specific product. Here is one way to build it on Azure, following the credit request from event to evidence (Figure 5).
Between allow and act, the world can change: a dispute opens, the eligible amount drops, or someone lowers the agent's level. So the executor never acts on a bare allow, and it reads decisions from a queue that only the policy decision point can send to. Each decision names the exact action, amount and target, the fact versions and authority it relied on, an expiry and an idempotency key. The executor then does four things.
Facts held in another system cannot join that write. Keep the expiry short for them, and let reconciliation flag any that changed. A decision that a person approved is checked the same way, with its expiry counted from the approval. Use one executor per capability or trust boundary, not one for the whole enterprise, so one stolen credential cannot write everywhere.
|
What you gain |
What it costs |
|
Replace models, frameworks and providers without touching rules, routes or process state. |
More parts to run: a registry, a policy decision point, executors and an evidence store. |
|
Authority changes are reviewed data changes, not releases. |
Contracts and schemas need owners, versions and reviews, like APIs. |
|
One evidence trail across agents, programs and people, and every implementation judged on the same criteria. |
Each contract needs labeled cases. Evaluation and shadow runs cost model calls and reviewer time. |
|
The process stays in charge, so you can adopt CDAA one capability at a time. |
Agents cannot act outside their contract, even when that would help. |
|
No agent can widen its own permissions, and injected text cannot become a fact. |
An extra decision call per action. The policy decision point must fail closed, and the executor must handle expiry, retries and reconciliation. |
Use CDAA when agents act on money, accounts, contracts or people, when they come from several sources, when rules change often, when you want to raise delegated authority step by step, or when you expect to change models or providers. Skip it for a single read-only assistant, a prototype, or open-ended research where the route cannot be known in advance. There an orchestrator fits better, and you can still keep invariants 03 and 04 behind it.
Models will change faster than your contracts, and contracts faster than your processes. Design so that each can change on its own.
Enterprise landing zones increasingly disable public network access on every PaaS service. That is the right security posture, but it breaks the default container delivery path: a Microsoft-hosted agent cannot reach a private Azure Container Registry (ACR), and a Function App cannot pull its image unless the pull is explicitly routed through the virtual network. In this post, we walk through a production-tested Azure DevOps pattern that builds a containerized Python Azure Function on self-hosted agents, pushes it to a private Premium ACR and deploys it to a private Linux Function App, with no public endpoint anywhere in the path.
Across customer engagements, the same gaps appear when teams move container workloads into a locked-down landing zone:
The result is either a failed deployment or a design that quietly reopens public access.
The pipeline is split into three planes, each fully private:
|
Plane |
Component |
Private connectivity |
|
Build |
Self-hosted VM agent pool per environment |
Runs inside the spoke VNet; egress through the hub firewall |
|
Registry |
Azure Container Registry (Premium) |
Private endpoint, public access disabled, admin user off |
|
Run |
Container Function App (App Service plan) |
Inbound private endpoint, VNet integration, image pull over VNet |
|
Area |
Requirement |
|
Network |
Spoke VNet with separate subnets for agents, private endpoints and Function App VNet integration (delegated to Microsoft.Web/serverFarms) |
|
Private DNS |
privatelink.azurecr.io (registry and regional data endpoint), privatelink.azurewebsites.net, and privatelink blob, queue, table and file zones for the Function storage account, all linked to the spoke or resolved through the hub DNS resolver |
|
Firewall egress (agents) |
Azure DevOps service and agent download endpoints, Microsoft Entra ID sign-in, mcr.microsoft.com for base images, and the package feeds the Dockerfile uses (for example PyPI) |
|
Build agent |
Linux VM with Docker Engine, Azure CLI and the Azure Pipelines agent; agent account in the docker group |
|
Service connection |
Azure Resource Manager connection (workload identity federation recommended) scoped to the environment resource group |
|
Registry |
Premium SKU (required for private endpoints) |
|
Hosting |
Function App on a Linux App Service plan (Basic or higher, or Elastic Premium) for VNet integration |
Each environment runs on its own agent pool inside its own network boundary. The image is tagged with the build ID so every deployment is traceable to a run.
- stage: DEV_BuildAndPush
pool:
name: $(dev_poolName) # <dev-agent-pool>
jobs:
- job: Build
workspace:
clean: all
steps:
- checkout: self
clean: true
- task: Bash@3
displayName: Build Docker image
inputs:
targetType: inline
script: |
set -e
docker build --no-cache --pull \
-f $(dockerfilePath) \
-t $(dev_acrLoginServer)/$(imageName):$(buildTag) \
<function-source-folder>
The service connection signs in to the registry through Microsoft Entra ID; no admin credentials are stored. Because the agent resolves the registry to its private IP, the push never leaves the VNet.
- task: AzureCLI@2
displayName: Push image to ACR
inputs:
azureSubscription: $(dev_azureServiceConnection) # <svc-conn>
scriptType: bash
scriptLocation: inlineScript
inlineScript: |
set -e
az acr login --name $(dev_acrName)
docker push $(dev_acrLoginServer)/$(imageName):$(buildTag)
The deploy stage applies environment app settings from source control, then points the app at the new tag.
inlineScript: |
set -e
az functionapp config appsettings set \
--name $(dev_functionAppName) --resource-group $(dev_resourceGroup) \
--settings @scripts/parameters/dev.functionapp-settings.json
az functionapp config set \
--name $(dev_functionAppName) --resource-group $(dev_resourceGroup) \
--linux-fx-version "DOCKER|$(dev_acrLoginServer)/$(imageName):$(buildTag)"
az functionapp restart \
--name $(dev_functionAppName) --resource-group $(dev_resourceGroup)
This is the setting most teams miss. With VNet integration alone, the platform still pulls the container image over the public path, so a private ACR rejects it. Enable Pull image over virtual network in the Deployment Center (or Container image pull under outbound traffic configuration on newer portal experiences), and use the managed identity for registry authentication.
az resource update --resource-group <rg> --name <function-app> \
--resource-type "Microsoft.Web/sites" \
--set properties.vnetImagePullEnabled=true
az functionapp config set --resource-group <rg> --name <function-app> \
--generic-configurations '{"acrUseManagedIdentityCreds": true}'
A verify stage confirms the app reports Running before a ManualValidation gate releases the same pipeline into TEST and STAGE, each with its own agent pool, registry and service connection.
|
Identity |
Role |
Scope |
|
Pipeline service principal |
AcrPush |
Registry |
|
Pipeline service principal |
Website Contributor |
Function App |
|
Function App managed identity |
AcrPull |
Registry |
|
Function App managed identity |
Data-plane roles it actually uses (Storage, Key Vault Secrets User, AI Search) |
Specific resources |
Reviewing the as-built environment surfaced improvements worth applying to any implementation of this pattern:
|
Finding |
Recommendation |
|
Runtime identity holds AcrPush |
Keep AcrPull only; push belongs to the pipeline identity |
|
Service principal has subscription-wide Contributor |
Scope to AcrPush on the registry and Website Contributor on the app |
|
Key Vault Secrets Officer on the runtime identity |
Use Key Vault Secrets User (read only) |
|
SCM and FTP basic-auth publishing enabled |
Disable both; deployments use Microsoft Entra ID |
|
CORS allows a localhost origin |
Remove from non-development environments |
|
Health check not configured |
Enable a health check path |
|
Approval gate pool misconfigured, no notified approvers |
Run ManualValidation in an agentless job (pool: server) and set approvers |
|
Registry retention and soft delete disabled |
Enable retention for untagged manifests; consider deploying by digest |
|
Symptom |
Likely cause |
Fix |
|
docker push times out or returns 403 |
Agent resolves the registry public IP |
Check the privatelink.azurecr.io zone link, including the regional data endpoint record |
|
Function App shows ImagePullFailure |
Image pull not routed through the VNet, or missing AcrPull |
Enable Pull image over virtual network; assign AcrPull to the app identity |
|
az acr login fails on the agent |
Docker not running or agent account not in the docker group |
Start Docker; add the agent account to the docker group and restart the agent |
|
Function App starts but host errors |
Storage account private endpoints or DNS missing |
Add blob, queue, table and file private endpoints and zones |
It’s been a big year for Capacitor: monthly downloads grew from about 4 million in December 2025 all the way to 33 million in November 2026, more than 8x over!
Let’s keep the momentum going: Capacitor 9 has hit general availability!
While every new major version of Capacitor brings support for new operating system versions — this year Android 17 and iOS 27 — we’ve managed to pack a lot more into this year’s release.
Without further ado, let’s dive into what’s new with Capacitor 9!
Capacitor 9’s headline feature is Cordova optionality. When Capacitor was first released in 2018, the ability to use Cordova’s massive ecosystem of plugins was a major enabler that allowed developers to go from testing out Capacitor to being able to release to production with it.
In the eight years since, Capacitor’s ecosystem has grown to the point where we regularly hear users ask if they could disable the Cordova-compatibility layer because they don’t have the need for it and would like any run-and-build time gains that come from excluding the layer.
Starting with Capacitor 9, the layer is only included when you need it. When you run npx cap sync, Capacitor only adds the Cordova runtime if it finds a Cordova plugin in your project. If your native code uses Cordova compatibility APIs without a Cordova plugin installed, set the forceCordovaInclusion configuration option to true.
The announcement and subsequent release of the iPhone Duo has sparked a renewed interest in foldable and large-screen devices. Capacitor 9 ships with foundational support for these devices so your app fills the screen instead of being letterboxed.
We are actively working on a new API that will allow you to tap into foldable, large-screen and multi-window features. It will arrive in a fast-follow release, Capacitor 9.1.
cap migrate will rewire the entry point for you automatically.npx @capacitor/plugin-migration-v8-to-v9@latest and follow the plugin update guide to point your Package.swift at the new Capacitor package.cap migrate turns it on for existing apps too. The change is driven by an upcoming Google Play requirement. To opt out, set minifyEnabled false in your release build type. Either way, test a release build before you ship, since R8 only runs in release builds.cap doctor and cap migrate will flag affected plugins.insetsHandling default is now 'native', which no longer injects --safe-area-inset-* CSS variables. Use env(safe-area-inset-*) instead, or set insetsHandling to 'css' to keep the old behavior.Please note, CocoaPods trunk is expected to go read-only on December 2, 2026. We highly recommend migrating your Capacitor iOS project to SPM if you have not done so already. We are planning to drop support for CocoaPods altogether in future versions of Capacitor.
To upgrade an existing app, install the latest Capacitor CLI with npm i -D @capacitor/cli@latest and run npx cap migrate. It handles most of the changes above. For the rest, including manual steps, follow the Capacitor 9 update guide.
As we count down to the end of the year, we want to share our gratitude for the Capacitor community. Without all of you, Capacitor wouldn’t be where it is today.
Capacitor 9 includes 30 commits from external contributors. Thank you to everyone who opened a pull request, and to everyone who filed an issue, tested a beta or built a plugin along the way. You can find everyone who contributed in the release notes.
We can’t wait to see what you build with Capacitor 9. Happy building!
The post Capacitor 9 Now Generally Available appeared first on Ionic Blog.