Khalid ShamsPrincipal Solutions Architect

Architect / Enterprise agent studio

Design the work.
Define its authority.

I start with a business outcome and build the smallest system that can deliver it. Follow two enterprise designs from the first decision to a monitored release, using the SHAMS Method.

Interactive teaching studio · synthetic data · no live AI calls

A requester brings a damaged lamp to a workshop. A software operator works at a cobalt context tray while an owner and a reviewer oversee the boundary.Outline operator: software metaphor · ⏸ Review boundary
The same workshop, with enterprise boundaries: evidence, identity, permission and a receipt.

01 · Choose the design

The task chooses the pattern. Governance sets its reach.

I keep architecture and authority separate. A more capable model does not earn more permission, and more agents do not automatically complete more work.

These choices produce a review proposal. They cannot authorize a real deployment. Start with read-only access when the consequences are unknown.

Proposed starting architecture

Document processing workflow

Ingest, extract, validate and stage are known steps. Start with a fixed workflow; add dynamic tool choice only when exceptions require it.

⏸ Write after explicit review

The application validates the proposed payload and waits for an authorized reviewer.

Payment and vendor-master changes remain outside this design.

Compare with the SHAMS autonomy ladder →
Compare the patterns and where they stop
PatternWhen I choose itControl that stays outside the model
Rules or conventional automationInputs and decisions are structured and stable. AI adds no measured benefit.Validation, access checks and transaction rules.
Grounded assistantFind evidence, explain it and cite it. A chat interface alone does not imply an agent.Document access, source freshness, answer checks and abstention.
AI workflowThe sequence is known; extraction, classification or drafting benefits from models.Routing, required fields, retries and release criteria.
Bounded tool agentThe next useful action depends on observed results; a fixed path performs poorly.Tool allowlist, per-call authorization, step budget, stop and approval.
Coordinator + specialistsIndependent work or genuinely different contexts justify delegation in evaluations.Separate identities, narrowed permissions, typed handoffs and one outcome owner.

These are design patterns, not a ranking. Computer use is a tool modality, not an authority level. Prefer scoped APIs where possible; a desktop operator needs an isolated session, constrained credentials and explicit action boundaries. Pattern source.

02 · Build through SHAMS

One continuous design record.

These are five lenses I revisit throughout delivery. The line connects the reading journey; it is not a runtime call or a ladder of increasing autonomy.

S · Scope · Gate 01

Name the outcome and its owner.

Prepare a checked invoice draft and its evidence for an accounts-payable reviewer.

Compare against manual entry plus OCR and deterministic validation on the same documents. Count accepted records, corrections and reviewer minutes, including exceptions.

Leave this gate with

An owner, a task boundary, a manual or rules-based baseline, a definition of done and a list of unacceptable outcomes. Agree on a pilot end date before building.

H · Harden · Gates 02, 03, 05

Give each capability a narrow contract.

One tenant, an approved document collection and a staging ledger. Read purchase orders and vendor records. Never issue a payment, change bank details or approve your own output.

✓ Read

Verified identity, permitted sources and approved tools.

⏸ Review

The AP reviewer sees the source pages, field differences, validation results, target record and exact proposed arguments. Approval binds to this payload and expires if it changes.

× Deny

Unknown tools, cross-tenant data, changed payloads and authority escalation.

Enforce these rules at retrieval and tool execution. A prompt, skill, MCP connection or approval screen cannot replace server-side authorization. A delegated agent receives the intersection of its own scope and the caller's scope, never broader inherited powers.

Leave this gate with

Identity and data-flow diagrams, tool schemas, input validation, reviewer roles, expiration rules, idempotency, a retry policy and a tested stop path.

A · Anchor · Gate 04

Make evidence traceable all the way back.

Quarantine and scan uploads; validate file type and size; classify the document; extract fields and table structure with page coordinates. Preserve the original and its content hash under the retention policy.

Check required fields, duplicate invoice keys, totals, currency and purchase-order references in code. Retrieve only permitted policy passages. Treat document text as evidence, never as a new instruction or permission.

Evidence card · synthetic example

Invoice INV-DEMO-104, page 1; purchase order PO-DEMO-28; current invoice policy with owner, version and review date. All records in this lesson are synthetic.

Separate the source of truth, the search index, the current context and stored conversation state. Each has its own access and deletion rules. Re-check permission on later turns; do not let a cache or memory reintroduce revoked material.

Leave this gate with

A source register, ingestion and deletion pipeline, permission propagation tests, citation format, freshness rule and an explicit insufficient-evidence outcome.

M · Measure · Gates 06, 07

Prove the outcome, including the failures.

Measure field exact-match and document-level acceptance on held-out vendors, layouts, scans and languages. Calibrate review thresholds against observed field errors. Extraction confidence is not proof that an invoice is legitimate.

Compare the full system with its baseline on the same held-out tasks. Repeat variable model trials. Check the final business state in code, use domain reviewers for judgment, and calibrate model graders against those reviewers. Report denominators and failures by slice.

Test conditionRequired observable outcome
Unreadable totalHold for correction; preserve the original page and missing-field reason.
Duplicate invoiceReject the duplicate staging key; do not create a second record.
Planted payment instructionNo payment capability exists; deny the attempted tool and record the event.
Write timeoutReconcile by idempotency key before retrying; report unknown until verified.

Total cost per accepted outcome = model + extraction + search + infrastructure + retries + human review, divided by accepted outcomes. If none succeed, report no successful outcome, not a zero cost.

Leave this gate with

A versioned test set, agreed quality and latency thresholds, a risk review, unit economics and release criteria. No universal confidence score or benchmark can approve this system for your estate.

S · Sustain · Gate 08

Release a version you can observe and withdraw.

Watch correction rate by field and vendor, exception queue age, duplicate prevention, extraction drift, receipt reconciliation and total cost per accepted record.

Progress from offline tests to shadow operation, then a limited pilot and a staged release when agreed gates pass. Shadow runs do not execute business writes. Pin the prompt, model deployment, retrieval configuration, policy and tool schema together.

Leave this gate with

An on-call owner, incident thresholds, a review queue with an escalation time, versioned release evidence, rollback instructions and a tested kill switch. Stopping an agent does not undo completed external actions; reconcile them separately.

Run the existing eight-gate review →

Read both complete example designs without changing the controls

From a document to a checked business record.

Goal
Prepare a checked invoice draft and its evidence for an accounts-payable reviewer.
Accountable role
Accounts-payable process owner
Baseline
Compare against manual entry plus OCR and deterministic validation on the same documents. Count accepted records, corrections and reviewer minutes, including exceptions.
Starting pattern
Ingest, extract, validate and stage are known steps. Add an agent only if resolving exceptions requires choosing among permitted tools. A fixed workflow can contain several model calls.
Boundary
One tenant, an approved document collection and a staging ledger. Read purchase orders and vendor records. Never issue a payment, change bank details or approve your own output.
Ingestion
Quarantine and scan uploads; validate file type and size; classify the document; extract fields and table structure with page coordinates. Preserve the original and its content hash under the retention policy.
Grounding
Check required fields, duplicate invoice keys, totals, currency and purchase-order references in code. Retrieve only permitted policy passages. Treat document text as evidence, never as a new instruction or permission.
Review
The AP reviewer sees the source pages, field differences, validation results, target record and exact proposed arguments. Approval binds to this payload and expires if it changes.
Evaluation
Measure field exact-match and document-level acceptance on held-out vendors, layouts, scans and languages. Calibrate review thresholds against observed field errors. Extraction confidence is not proof that an invoice is legitimate.
Operation
Watch correction rate by field and vendor, exception queue age, duplicate prevention, extraction drift, receipt reconciliation and total cost per accepted record.
Improvement
Label adjudicated extraction errors and train a new custom document model when justified. Hold out unseen layouts and suppliers. Rebuild the index for policy changes. These are separate changes from fine-tuning a language model.
Test conditionRequired observable outcome
Unreadable totalHold for correction; preserve the original page and missing-field reason.
Duplicate invoiceReject the duplicate staging key; do not create a second record.
Planted payment instructionNo payment capability exists; deny the attempted tool and record the event.
Write timeoutReconcile by idempotency key before retrying; report unknown until verified.

An answer that stays inside the employee's access.

Goal
Answer an employee's IT-policy question with current, accessible evidence, or explain why it cannot be answered.
Accountable role
Internal service owner and knowledge owners
Baseline
Compare search plus the existing help desk against grounded answers on the same questions. Measure supported answers, correct abstention, user resolution and total service cost.
Starting pattern
A chat interface does not require an autonomous agent. Start with authorized retrieval and a cited answer. Add narrowly scoped actions, such as creating an access-request ticket, only as a separate capability.
Boundary
Verify employee and tenant identity. Filter every retrieval by current access before content reaches the model. No payroll lookup, cross-user memory, entitlement changes or access grants.
Ingestion
Register source owners, approved versions, review dates, sensitivity and access metadata. Chunk with document and section references. Propagate edits, deletions and permission changes to the index and caches.
Grounding
Derive user and group scope on the server, not from a prompt. Retrieve only authorized passages. If evidence is absent, conflicting or stale, abstain and route to the owner. Re-check access on follow-up turns and before writes.
Review
The employee reviews the ticket category and data being shared. The service owner approves the action policy. Creating a request never grants the requested entitlement.
Evaluation
Measure claim support, citation correctness, authorized retrieval recall and correct abstention. Test employee roles, revoked groups, follow-up questions, stale policies and adversarial documents. A plausible answer can still fail.
Operation
Watch unsupported-claim and abstention rates, permission failures, source age, unresolved questions, latency, ticket duplicates and cost per verified resolution.
Improvement
Fix source content or retrieval when evidence is wrong or missing. Adjust prompts for recurring response errors. Use reviewed feedback for evaluation cases; conversations do not automatically become training data.
Test conditionRequired observable outcome
Another employee's documentExclude it before model context; do not reveal its title or existence.
Missing policyAbstain and name the supported escalation route.
Access revoked mid-runRe-check authorization; refuse the write despite earlier approval.
Request to grant accessOffer the request process; the grant operation is not an available tool.

03 · Follow the work

A proposal meets a real boundary.

Move through a synthetic run and inspect the public record. Change a condition to see where it stops. This demonstrates enforcement logic; it does not test a real model or cloud deployment.

Write-related conditions apply when the design includes a business write. Call counts are illustrative tool calls in this simulation, not a cloud cost estimate.

Enterprise runtime · example architecture

Enterprise workflow with evidence, a model, review and an execution boundary Identity scopes evidence before it reaches the work tray. A model proposes an answer or tool call. The application checks permission and, when required, routes it to a human reviewer. Only the protected execution service reaches the business system. Every reached step adds a receipt to the event trail. APPLICATION · TENANT + TASK SCOPE IdentityUser + service✓ VERIFY SCOPE Evidence libraryOwned · versioned · filtered Pinned modelProposes · does not authorize Sources+ checksBounded work trayThis request's context only CHECKPermission Arguments + policy REVIEWExact payloadHuman reviewer BUSINESS SYSTEM Staging ledger EVENT TRAIL · VERSIONS · POLICY DECISIONS · RECEIPTS CALL LIMIT

● Solid ink: evidence⇢ Cobalt dashed: control⋯ Cobalt dotted: reviewDashed enclosure: boundary

Instruments represent software. The solid figure is a person. The illustration is a teaching abstraction, not an infrastructure inventory.

Step 1

READY

Verify identity and scope

Validate the caller and attach the permitted tenant and task scope before accessing evidence.

Enforced by
Application identity boundary
Observable event
identity.verified
Tool calls used
0 of 6
Example action contractstage_invoice_draft(invoice_id=INV-DEMO-104, purchase_order=PO-DEMO-28)
Inspect this run's event trail

Only events reached so far appear here. Statuses are simulated. This is application evidence, not hidden model reasoning.

  1. identity.verified · caller and scope checked

04 · Map it to a platform

Keep the control plane. Choose the model deliberately.

This is a reference architecture I would adapt to the client's estate. The model is a replaceable component inside a governed application, with a documented processing boundary.

Pin an approved model deployment and API version. Confirm region, networking, residency, retention, quotas and lifecycle for that specific deployment.

Control or capabilityAzure reference implementationWhat still needs to be designed
Employee and service identityMicrosoft Entra ID; managed identities for supported service calls.Delegated user scope, tenant isolation, tool identity and separation of reviewer duties. A service identity is not the employee's permission.
Document intakeQuarantine storage, scanning integration, Azure Blob Storage and Document Intelligence.File validation, rights to process, page provenance, retention, schema checks and human correction. Source.
Authorized retrievalAzure AI Search with an application-enforced security-filter pattern, or a supported document-permission feature after verification.Trusted principal resolution, mandatory tenant/ACL filters, revoke/delete propagation and permission-aware caches. Do not accept an ACL supplied by the model. Source.
Application and orchestrationA versioned service on Container Apps or App Service; queues and durable state where needed. Foundry Agent Service is an option when its verified capabilities fit.Business state machine, typed handoffs, bounded loops, cancellation, per-run budgets and durable approval state. Verify any managed-runtime tool, network and model combination before selecting it.
Model adapterApproved, pinned Azure model deployment.Evaluate prompts, tool schemas and output validation per model. Provider adapters do not make different models behaviorally equivalent.
Protected actionsApplication-owned tool gateway, optionally fronted by API Management; scoped business APIs.Authorize immediately before execution, validate arguments, bind review to a payload hash, expire approvals, use idempotency and reconcile receipts. MCP can expose tools; it does not grant authority.
Observation and releaseOpenTelemetry application spans, Azure Monitor and Application Insights; versioned evaluation and release pipeline.Redaction, retention, access to traces, outcome checks, review alerts, cost attribution and rollback drills. Instrument policy decisions as well as model calls. Source.

Claude in Foundry has Azure-hosted and Anthropic-hosted options, with different processing boundaries and per-model availability. Anthropic is the seller and operator for both. Confirm the exact hosting version, region, terms and lifecycle; do not infer data residency from the Azure portal. Configure applicable inference-time content safety instead of assuming deployment-time filtering. Availability · Data processing.

What changes when I introduce Anthropic models?

I preserve application authorization, evidence provenance, tool contracts and approval records. I replace the model adapter, check message and tool-use semantics, rerun the evaluation suite and verify the selected endpoint's data-processing terms. Direct Anthropic API access is a separate procurement and data-flow decision from either Foundry hosting option. A model fallback also needs approval for its data boundary and a passed evaluation; it must not silently reroute sensitive content.

A specialist architecture needs independent evaluation of delegation and result aggregation. Specialists get bounded work orders, limited context and a shared run identifier. Only the authorized execution service can commit a business change. The coordinator cannot manufacture permission by asking a different specialist.

05 · Observe and improve

Every improvement is a versioned change.

I ask which part failed before deciding what to train. A thumbs-up, a longer prompt and a model upgrade are different interventions. None bypasses release evaluation.

Diagnose first

Find the component that failed.

Label adjudicated extraction errors and train a new custom document model when justified. Hold out unseen layouts and suppliers. Rebuild the index for policy changes. These are separate changes from fine-tuning a language model.

Update the source or retrieval

Repair approved content, permissions or indexing. Re-evaluate retrieval and answers. This updates evidence, not language-model weights.

  1. Capture a failureMinimized trace, outcome and source versions.
  2. Review and labelDomain owner adjudicates; remove sensitive content.
  3. Change one componentSource, retriever, prompt, tool, policy or model.
  4. Evaluate on held-out casesCompare with baseline; test neighboring failure modes.
  5. Approve and releaseShadow, pilot, monitor; withdraw on agreed triggers.
Knowledge updates, memory, fine-tuning and training are different
ChangeWhat changesEvidence I require
RAG / knowledge updateApproved source material, chunks, metadata or retrieval. Model weights stay unchanged.Retrieval recall, freshness, citations, deletion and permission propagation.
Prompt, skill or tool updateInstructions, available procedures, schemas or executable code.Task outcomes, argument validation, error handling and regressions.
Conversation memoryApplication-managed state loaded into a later context.User/tenant scope, provenance, expiry, correction and deletion. It is not automatic model learning.
Custom document-model trainingAn extraction or classification model learns from labeled documents.Held-out layouts, field errors and representative document slices. Keep train and evaluation sets separate.
Language-model fine-tuningWeights are adapted, only if the selected provider and deployment support it.Data rights, privacy review, documented train/eval separation and a measured advantage over simpler changes. Do not assume Claude fine-tuning is available in the chosen deployment.

Monitor the task, the boundary and the service.

Business outcome

Accepted results, correction and rework, unresolved cases, reviewer workload and time to completion.

Governance

Denied calls, authorization changes, evidence failures, approval age, unexpected tool use and deletion lag.

Operations

p95 latency, timeouts, retries, tokens, cost per accepted result, source age and version-level regressions.

Log correlation IDs, versions, source identifiers, policy decisions, redacted tool arguments and verified results. Capture sensitive payloads only under an explicit access and retention policy. Traces show observed behavior; they do not reveal a model's complete internal reasoning or prove the answer correct.

06 · Take it to review

A design you can put in front of an owner.

Keep the choices, boundary, evidence, tests and operating plan together. The record labels unresolved decisions; it is not a signed approval or a claim that a system has been deployed.

Inputs stay in this page's memory until you download them or leave. No storage or model call is used by this studio. Avoid entering confidential client details.

Enable JavaScript to generate a record from your selected design. The complete worked examples above remain available without it.

Sources and limits

Architecture choices with a checkable basis.

The worked designs and SHAMS mapping are my proposed teaching architecture. Product details below were checked on 12 October 2026. Verify the exact service, model and deployment at implementation time.