Projects · Architecture in detail

How my AI projects are built, layer by layer

The AI projects I've built, co-built or led onto a governed platform, strongest first: governed agent platforms, the agents that run on them, and how earlier work was moved onto them. Open any project to go from the problem it solves to its layers, components, numbered flow and controls; each part that follows a pattern from my Enterprise Agent Playbook has a How to build this → link to the section that explains it.

16 projects · strongest first

Pick a project. Every click goes one layer deeper.

  1. 01Built Google Cloud

    Google Workspace agent platform

    A governed platform for AI agents that work on Google Workspace data, where agents never hold the credentials and never see real identities.7 layers · 16 componentsExplore
  2. 02Led and built Kubernetes

    Agent platform foundation

    A secure-by-default foundation for shipping governed AI agents on enterprise Kubernetes.6 layers · 12 componentsExplore
  3. 03Built Microsoft Entra ID · ServiceNow

    Directory group membership agent

    An access-request agent that reads a ServiceNow ticket, lets rules or a named approver decide, changes the directory group through Microsoft Graph and proves the change before closing the ticket.7 layers · 12 componentsExplore
  4. 04Built Azure · AWS

    Outage response agent

    An operations agent that works an outage from both ends: it responds when a server goes down, and it is designed to flag trouble before the server becomes unavailable.6 layers · 16 componentsExplore
  5. 05Built Google Cloud

    Workspace usage and licence-fit analyzer

    Licence right-sizing for Google Workspace, with rules that decide and an AI that advises, under risk-based human approval.5 layers · 10 componentsExplore
  6. 06Built Google Cloud

    Workspace security evaluator

    Automated Google Workspace security audit where rules give the verdicts and AI writes the remediation notes.6 layers · 12 componentsExplore
  7. 07Extended and hardened Azure · Kubernetes

    Account monitoring agent

    An agent that watches account financials, flags unusual movements, explains them, and answers questions about the data in plain language.6 layers · 13 componentsExplore
  8. 08Co-built Kubernetes

    Proposal completeness agent

    Checks a draft proposal against the client's request document and shows which requirements are covered, partly covered or missing.5 layers · 11 componentsExplore
  9. 09Built Google Cloud

    Reseller client-book assistant

    Ask-the-book assistant for a Google Workspace reseller: the model picks the filters, code computes every number.5 layers · 11 componentsExplore
  10. 10Built Google Cloud

    Support-ticket enrichment

    AI triage drafts for a Google Workspace support desk — summary, problem statement and ranked next steps, always reviewed by an engineer.5 layers · 10 componentsExplore
  11. 11Co-built Microsoft stack

    RevokAI — Governed Access Control

    A governed AI compliance control for access revocation: AI correlates, rules and a human decide, and every action is evidenced.5 layers · 7 componentsExplore
  12. 12Vertex AI

    Customer Outreach Agent

    Evidence-gated customer outreach: research, score, then draft, with a human reviewing every message.5 layers · 7 componentsExplore
  13. 13Led and built Case study

    Case study: moving earlier agents onto the governed platform

    Moving working AI agents onto a governed platform without losing a single business rule.4 layers · 6 componentsExplore
  14. 14First generation

    Multi-Agent AI Platform — first generation

    One governed foundation on Google Cloud that gives specialist AI agents shared sign-in, data-tier separation, central model management, audit logging and a tested, region-only deploy path.9 layers · 27 componentsExplore
  15. 15Runs on the platform

    Change Management (OCM) Agent

    Turns a formal four-phase change-management methodology into software: each deliverable is generated from a versioned methodology document and stamped with the version that produced it.8 layers · 16 componentsExplore
  16. 16Runs on the platform

    Infra Health Check Agent

    Turns raw multi-site infrastructure health-check exports into structured, severity-labeled findings, issues tracked across runs, and reports ready to share.6 layers · 15 componentsExplore

Want the patterns behind these builds?

The Enterprise Agent Playbook sets out the reference architecture, the control stack and the delivery pipeline these projects use, in a vendor-neutral form you can apply to your own agents.

01 / 16 Built Google Cloud

Google Workspace agent platform

A governed platform for AI agents that work on Google Workspace data, where agents never hold the credentials and never see real identities.

My role

Built it end to end: portal, tool servers, policies, release tooling and security checks.

Problem

AI agents that analyse an organisation's Google Workspace (licences, security settings, reseller subscriptions, support tickets) need very powerful admin-level read access. Giving that access to each agent, with weak sign-in and no audit trail, is a risk no security team accepts.

What it does

A shared platform that the agents run on. Users sign in through one portal; an access list decides who may use each agent and who may see real data. All Workspace access goes through a single read-only tool server that holds the only credential, checks a policy before every read, and replaces people's identities with keyed pseudonyms before any agent or model sees the data. A second tool gives read-only ticket access, and a third chooses and automatically re-qualifies the Gemini model each agent uses. Changes reach the release environment only through one scripted promotion that reuses the exact tested images and runs a security check suite before and after.

Value

The powerful credential lives in one small, auditable place. Agents can be added without widening access. Every read is logged in a tamper-evident trail. Releases are repeatable and reversible.

Architecture at a glance7 layers · 16 components

Top to bottom, from the person using it down to data and delivery. Open a layer to see its components.

  1. Portal and agent pages

    One sign-in portal that launches each agent's page.

    React · Firebase Hosting
    How to build this Playbook §2 · Reference architecture
  2. Verified sign-in

    Google sign-in with tokens verified on every request.

    Identity Platform
    How to build this Playbook §4.8 · Secrets and identity

    Access list and data tiers

    Roles and per-agent membership; two data tiers, real data or synthetic data.

    Roles · per-agent membership
    How to build this Playbook §4.7 · Multi-tenancy
  3. Agent services and jobs

    Each agent runs as its own containerised service, with background jobs for long runs.

    Cloud Run
    How to build this Playbook §2 · Reference architecture

    Policy sidecar

    An Open Policy Agent sidecar beside every service decides each request and tool call.

    Open Policy Agent (Rego)
    How to build this Playbook §4.4 · Policy
  4. Gemini models

    The model each agent uses, chosen through the model registry.

    Vertex AI

    Prompt and answer screening

    Screens every prompt and every answer before it is used.

    Model Armor · Sensitive Data Protection
    How to build this Playbook §7 · Security for agents
  5. Workspace reader

    Holds the only Workspace credential; reads read-only and replaces identities with keyed pseudonyms.

    FastMCP · read-only, keyless delegation
    How to build this Playbook §5.2 · MCP

    Ticket reader

    Read-only access to support tickets.

    FastMCP
    How to build this Playbook §5.1 · Tool design

    Model registry

    Chooses the Gemini model for each agent and automatically re-qualifies it.

    FastMCP
    How to build this Playbook §5.4 · Gateway and registry
  6. Relational store

    One schema per component.

    Cloud SQL (PostgreSQL)

    Rate limits and kill switch

    Shared counters and a switch that stops the agents.

    Memorystore Redis
    How to build this Playbook §4.5 · Kill switch and dry-run

    Create-only audit store

    Hash-chained audit entries that can be added but not changed.

    Create-only storage
    How to build this Playbook §4.3 · Audit

    Secrets

    Runtime secrets, never in source.

    Secret Manager
    How to build this Playbook §4.8 · Secrets and identity
  7. Checks and builds

    Checks on every change; images built only from committed code.

    GitHub Actions · Cloud Build · Artifact Registry
    How to build this Playbook §9 · Delivery pipeline

    Digest-based promotion

    Staging first, then one scripted promotion of the exact tested images, with a lock and a security check suite before and after.

    Scripted promotion
    How to build this Playbook §9 · Delivery pipeline
Go deeper
Architecture — layered view7 layers · 16 components
Google Workspace agent platform: layered architecture Layers from top to bottom: Experience, Identity, Agents, AI, Tools (MCP servers), Data, Delivery. Numbered badges on each component match the steps listed below the diagram. Components outlined in orange link to the playbook section on how that part is built. 01 EXPERIENCE Portal and agent pages — how to build this (Playbook §2 Reference architecture)Portal and agent pagesReact · Firebase Hosting↗ Playbook §2 02 IDENTITY Verified sign-in — how to build this (Playbook §4.8 Secrets and identity)Verified sign-inIdentity Platform↗ Playbook §4.8 1 Access list and data tiers — how to build this (Playbook §4.7 Multi-tenancy)Access list and data tiersRoles · per-agent membership↗ Playbook §4.7 1 03 AGENTS Agent services and jobs — how to build this (Playbook §2 Reference architecture)Agent services and jobsCloud Run↗ Playbook §2 2 5 Policy sidecar — how to build this (Playbook §4.4 Policy)Policy sidecarOpen Policy Agent (Rego)↗ Playbook §4.4 3 04 AI Gemini modelsGemini modelsVertex AI 5 Prompt and answer screening — how to build this (Playbook §7 Security for agents)Prompt and answer screeningModel Armor · Sensitive Data Protection↗ Playbook §7 5 05 TOOLS (MCP SERVERS) Workspace reader — how to build this (Playbook §5.2 MCP)Workspace readerFastMCP · read-only, keyless delegation↗ Playbook §5.2 2 3 4 6 Ticket reader — how to build this (Playbook §5.1 Tool design)Ticket readerFastMCP↗ Playbook §5.1 Model registry — how to build this (Playbook §5.4 Gateway and registry)Model registryFastMCP↗ Playbook §5.4 5 06 DATA Relational storeRelational storeCloud SQL (PostgreSQL) 5 Rate limits and kill switch — how to build this (Playbook §4.5 Kill switch and dry-run)Rate limits and kill switchMemorystore Redis↗ Playbook §4.5 Create-only audit store — how to build this (Playbook §4.3 Audit)Create-only audit storeCreate-only storage↗ Playbook §4.3 3 6 Secrets — how to build this (Playbook §4.8 Secrets and identity)SecretsSecret Manager↗ Playbook §4.8 07 DELIVERY Checks and builds — how to build this (Playbook §9 Delivery pipeline)Checks and buildsGitHub Actions · Cloud Build · Artifact Registry↗ Playbook §9 Digest-based promotion — how to build this (Playbook §9 Delivery pipeline)Digest-based promotionScripted promotion↗ Playbook §9
numbered badge = flow step orange outline = opens its playbook section

FlowHow a request moves through it

  1. Step 1: The user signs in; the service verifies the token and looks up the access list.
  2. Step 2: The agent asks the Workspace tool for data, proving its own service identity.
  3. Step 3: The tool checks policy (is this caller allowed this tool; is this tenant cleared here), writes an audit entry, then reads Workspace with a read-only, keyless delegated credential.
  4. Step 4: Identities are split off and replaced with keyed pseudonyms; the agent receives only an id.
  5. Step 5: The agent reads the pseudonymised snapshot, gets its model from the registry, has the prompt and the answer screened, and stores its result.
  6. Step 6: A reviewer who needs a real name asks the tool, and that lookup is audited too.

ControlsGuardrails built in

Verified sign-in on every request
Tokens are verified server-side; access comes from roles and per-agent membership.How to build this Playbook §4.8 · Secrets and identity
Fail-closed policy checks
Policy is checked before every read; if the check can't run, the read doesn't happen.How to build this Playbook §4.4 · Policy
Read-only by construction
Read-only scopes plus a transport that only allows GET requests.How to build this Playbook §5.1 · Tool design
Keyed pseudonymisation
People's identities are replaced before any agent or model sees the data.How to build this Playbook §4.9 · PII and DLP
Prompt and response screening
Every prompt and answer is screened before use.How to build this Playbook §7 · Security for agents
Tamper-evident audit
A hash-chained, create-only audit trail, plus a 90-day retention job with least privilege.How to build this Playbook §4.3 · Audit
Repeatable, reversible releases
Images built only from committed code; digest-based promotion with a lock; an automated security check suite; alerts on out-of-process changes; pinned dependencies and scanned images.How to build this Playbook §9 · Delivery pipeline
Human in the loop

Administrators manage access. Clearing a new tenant or ticket project for real data is a named sign-off recorded with the policy. A named releaser confirms each promotion.

Stack
PythonFastAPIModel Context Protocol (FastMCP)Open Policy Agent (Rego)Google Cloud RunCloud SQL (PostgreSQL)Memorystore RedisSecret ManagerVertex AI (Gemini)Model ArmorSensitive Data ProtectionFirebase HostingIdentity PlatformKeycloak (OIDC)Cloud BuildArtifact RegistryGitHub Actionspytest
02 / 16 Led and built Kubernetes

Agent platform foundation

A secure-by-default foundation for shipping governed AI agents on enterprise Kubernetes.

My role

Led and built it; the platform operators added image signing on top.

Problem

Teams that want to put AI agents on a shared enterprise Kubernetes platform face the same hurdles each time: proving who is calling an agent, deciding what each agent and each tool is allowed to do, keeping secrets and unpinned dependencies out of the build, and meeting the platform's rules for images and deployment. Solved one agent at a time, these controls drift, and a single gap at the trust boundary can let a caller claim permissions they do not have.

What it does

A reusable foundation that every agent starts from. It contains a small reference agent that exercises the whole path end to end, a shared identity module that verifies each caller's signed token, a policy layout in which Open Policy Agent decides on every request and every tool call, and a suite of automated "contract" tests that hold every project to the same rules. A delivery pipeline tests, scans and builds container images, and a read-only health check tells a developer whether the platform's model gateway, tracing and tool gateway are reachable and whether their keys work. New agents are created by copying the reference agent and renaming it.

Value

New agents inherit identity, authorisation, secret handling and supply-chain controls instead of re-implementing them. Rules are enforced by tests in the pipeline, not by convention. Each agent stays independent (own policy, prompt, tests, image), so teams can change and release them separately. Framework upgrades arrive as a tested, reviewable change.

Architecture at a glance6 layers · 12 components

Top to bottom, from the person using it down to data and delivery. Open a layer to see its components.

  1. Dev container and setup

    One setup script verifies the framework package by checksum and installs a checksum-pinned policy engine.

    Dev Containers
    How to build this Playbook §9 · Delivery pipeline

    Local checks

    One script runs every check locally before a change is pushed.

    pytest · policy tests

    Read-only health check

    Tells a developer whether the model gateway, tracing and tool gateway are reachable and whether their keys work.

    Read-only probe
    How to build this Playbook §4.6 · Health and telemetry
  2. Agent-to-agent endpoint

    The agent's JSON-RPC entry point.

    A2A protocol
    How to build this Playbook §5.3 · A2A delegation

    Token verifier

    Checks signature, issuer, audience and required claims; ignores any identity claimed in the request body.

    Keycloak (OIDC / JWT)
    How to build this Playbook §4.8 · Secrets and identity
  3. Per-agent policy sidecar

    Deny by default, with role and tenant checks and an explicit allow-list of tools; reachable only inside the pod.

    Open Policy Agent (Rego)
    How to build this Playbook §4.4 · Policy
  4. Reference agent

    A small agent that exercises the whole path end to end; new agents start as a copy.

    LangGraph on an enterprise agent framework
    How to build this Playbook §2 · Reference architecture
  5. LLM gateway

    Fronts the hosted models.

    LiteLLM
    How to build this Playbook §5.4 · Gateway and registry

    Tracing and prompt registry

    Traces every run; versioned prompts kept in sync with the code.

    Langfuse
    How to build this Playbook §6 · Evals and observability
  6. Contract and policy tests

    Contract, unit and policy tests plus secret scanning on every change.

    GitHub Actions · gitleaks
    How to build this Playbook §9 · Delivery pipeline

    Pinned, scanned images

    Base images pinned by digest; vulnerability gate before deployment.

    Docker · Trivy
    How to build this Playbook §9 · Delivery pipeline

    GitOps deployment

    Deployment to Kubernetes with secrets injected from a vault.

    ArgoCD · Kyverno · External Secrets · Azure Key Vault
    How to build this Playbook §9 · Delivery pipeline
Go deeper
Architecture — layered view6 layers · 12 components
Agent platform foundation: layered architecture Layers from top to bottom: Developer experience, Edge and identity, Policy, Orchestration, Model and observability, Delivery. Numbered badges on each component match the steps listed below the diagram. Components outlined in orange link to the playbook section on how that part is built. 01 DEVELOPER EXPERIENCE Dev container and setup — how to build this (Playbook §9 Delivery pipeline)Dev container and setupDev Containers↗ Playbook §9 Local checksLocal checkspytest · policy tests Read-only health check — how to build this (Playbook §4.6 Health and telemetry)Read-only health checkRead-only probe↗ Playbook §4.6 02 EDGE AND IDENTITY Agent-to-agent endpoint — how to build this (Playbook §5.3 A2A delegation)Agent-to-agent endpointA2A protocol↗ Playbook §5.3 1 Token verifier — how to build this (Playbook §4.8 Secrets and identity)Token verifierKeycloak (OIDC / JWT)↗ Playbook §4.8 2 03 POLICY Per-agent policy sidecar — how to build this (Playbook §4.4 Policy)Per-agent policy sidecarOpen Policy Agent (Rego)↗ Playbook §4.4 3 5 04 ORCHESTRATION Reference agent — how to build this (Playbook §2 Reference architecture)Reference agentLangGraph on an enterprise agent framework↗ Playbook §2 4 5 6 05 MODEL AND OBSERVABILITY LLM gateway — how to build this (Playbook §5.4 Gateway and registry)LLM gatewayLiteLLM↗ Playbook §5.4 4 Tracing and prompt registry — how to build this (Playbook §6 Evals and observability)Tracing and prompt registryLangfuse↗ Playbook §6 4 6 06 DELIVERY Contract and policy tests — how to build this (Playbook §9 Delivery pipeline)Contract and policy testsGitHub Actions · gitleaks↗ Playbook §9 Pinned, scanned images — how to build this (Playbook §9 Delivery pipeline)Pinned, scanned imagesDocker · Trivy↗ Playbook §9 GitOps deployment — how to build this (Playbook §9 Delivery pipeline)GitOps deploymentArgoCD · Kyverno · External Secrets · Azure KeyVault↗ Playbook §9
numbered badge = flow step orange outline = opens its playbook section

FlowHow a request moves through it

  1. Step 1: A caller sends a request with a signed identity token.
  2. Step 2: The agent verifies the token against the identity provider's published keys and ignores any identity claimed in the request body.
  3. Step 3: The policy engine checks whether this caller, in this tenant, may start the agent.
  4. Step 4: The agent loads its system prompt from the prompt registry and calls the model through the gateway.
  5. Step 5: Before each tool runs, the policy engine is asked again; a tool not on the allow-list never runs.
  6. Step 6: The answer is returned and the run is traced.

ControlsGuardrails built in

Verified caller identity
Identity is taken only from a cryptographically verified token; it fails closed when verification is not configured.How to build this Playbook §4.8 · Secrets and identity
Deny-by-default authorisation
Role and tenant checks on every request and every tool call; the policy engine is isolated inside the pod and set to fail closed.How to build this Playbook §4.4 · Policy
No secrets in source
Ignored local files, empty-value templates, secret scanning on every change, runtime secrets from a vault.How to build this Playbook §4.8 · Secrets and identity
Pinned supply chain
Framework package by checksum, base images by digest, CI actions by commit, build tools by checksum; a vulnerability gate on images before deployment.How to build this Playbook §9 · Delivery pipeline
Hardened containers
Non-root, read-only filesystem, no added capabilities.How to build this Playbook §7 · Security for agents
Contract tests
Automated contract tests block any change that breaks the rules above.How to build this Playbook §9 · Delivery pipeline
Human in the loop

Every change needs approval from a designated code owner before it merges, deployment changes are reviewed by the platform's operators, and a framework upgrade is proposed automatically but merged only after a person has read the release notes. The reference agent itself is read-only and takes no actions that need approval.

Stack
PythonLangGraphOpen Policy Agent (Rego)Keycloak (OIDC / JWT)LiteLLMLangfuseKubernetesDockerGitHub ActionsTrivygitleaksArgoCDKyvernoExternal SecretsAzure Key VaultA2A protocolpytestDev Containers
03 / 16 Built Microsoft Entra ID · ServiceNow

Directory group membership agent

An access-request agent that reads a ServiceNow ticket, lets rules or a named approver decide, changes the directory group through Microsoft Graph and proves the change before closing the ticket.

My role

Built it: design, workflow engine, integrations, approval rules, chat and request pages, tests.

Problem

Requests to add or remove someone from a directory security group arrive as free text and are worked by hand. Automating them is risky if an AI is allowed to decide who gets access.

What it does

Requests come from a chat page or a ServiceNow catalog item. A language model only turns the text into a structured request. Code checks the requester, the group and the user against an allowlist of directory object IDs, then approval rules decide: approve automatically, route to a named approver in ServiceNow, or decline. After approval the request is checked again, the membership is changed through Microsoft Graph, read back from Microsoft Entra ID to confirm, recorded in an audit log, and the ticket is closed with notes at every step.

Value

Shows how routine access tickets can be completed end to end while the approval decision stays with written rules or a person, with a full record of who asked, who or what approved, and what actually changed.

Architecture at a glance7 layers · 12 components

Top to bottom, from the person using it down to data and delivery. Open a layer to see its components.

  1. Chat page and request form

    Describe the request; confirm a preview before a ticket is raised.

    Web pages

    ServiceNow catalog and approvals

    Raise requests and approve them where people already work.

    ServiceNow
  2. API service

    Chat preview and confirm endpoints.

    FastAPI

    Polling worker

    Picks up tickets and checks the requester.

    Python
  3. State-machine engine

    Moves each request through fixed states, with no duplicate writes.

    Python
    How to build this Playbook §2 · Reference architecture
  4. LLM interpreter

    Extracts action, user, group and reason in a strict schema; flags unclear or manipulative text.

    Azure AI Foundry · JSON-schema structured output
    How to build this Playbook §7 · Security for agents
  5. Object-ID allowlist

    Only listed directory objects can ever be touched.

    Allowlist
    How to build this Playbook §4.4 · Policy

    Approval rules

    Approve automatically, route to a named approver, or decline; the default cannot auto-approve.

    Rules file in version control
    How to build this Playbook §8 · Autonomy ladder
  6. ServiceNow client

    Tickets, work notes and approvals.

    Table API · Service Catalog API
    How to build this Playbook §5.1 · Tool design

    Microsoft Graph client

    Lookup, membership check, add and remove; reads back to verify.

    Microsoft Graph · Entra ID
    How to build this Playbook §5.1 · Tool design
  7. Request state

    Where each request is in its workflow.

    SQLite

    Append-only audit log

    Who asked, who or what approved, and what changed.

    Append-only log
    How to build this Playbook §4.3 · Audit
Go deeper
Architecture — layered view7 layers · 12 components
Directory group membership agent: layered architecture Layers from top to bottom: Experience, API and worker, Workflow, AI interpretation, Rules, Integrations, State and audit. Numbered badges on each component match the steps listed below the diagram. Components outlined in orange link to the playbook section on how that part is built. 01 EXPERIENCE Chat page and request formChat page and request formWeb pages 1 ServiceNow catalog and approvalsServiceNow catalog and approvalsServiceNow 1 5 02 API AND WORKER API serviceAPI serviceFastAPI 1 Polling workerPolling workerPython 2 03 WORKFLOW State-machine engine — how to build this (Playbook §2 Reference architecture)State-machine enginePython↗ Playbook §2 6 04 AI INTERPRETATION LLM interpreter — how to build this (Playbook §7 Security for agents)LLM interpreterAzure AI Foundry · JSON-schema structured output↗ Playbook §7 3 05 RULES Object-ID allowlist — how to build this (Playbook §4.4 Policy)Object-ID allowlistAllowlist↗ Playbook §4.4 4 6 Approval rules — how to build this (Playbook §8 Autonomy ladder)Approval rulesRules file in version control↗ Playbook §8 5 06 INTEGRATIONS ServiceNow client — how to build this (Playbook §5.1 Tool design)ServiceNow clientTable API · Service Catalog API↗ Playbook §5.1 2 8 Microsoft Graph client — how to build this (Playbook §5.1 Tool design)Microsoft Graph clientMicrosoft Graph · Entra ID↗ Playbook §5.1 4 7 07 STATE AND AUDIT Request stateRequest stateSQLite 8 Append-only audit log — how to build this (Playbook §4.3 Audit)Append-only audit logAppend-only log↗ Playbook §4.3 8
numbered badge = flow step orange outline = opens its playbook section

FlowHow a request moves through it

  1. Step 1: A user describes the request in chat (and confirms a preview) or raises a ServiceNow ticket.
  2. Step 2: The worker picks up the ticket and checks the requester.
  3. Step 3: The model extracts action, user, group and reason; it flags unclear or manipulative text.
  4. Step 4: Code resolves names to directory objects and checks them against the allowlist.
  5. Step 5: Approval rules approve automatically, route to the named approver, or decline.
  6. Step 6: The request is re-checked against the approval, the allowlist and current membership.
  7. Step 7: The change is made through Microsoft Graph and read back from the directory.
  8. Step 8: The audit record is written and the ticket is closed with the outcome.

ControlsGuardrails built in

AI interprets only
The model never approves and never supplies object IDs; suspected prompt injection is always declined.How to build this Playbook §3 · Build principles
Allowlist by object ID
Requester, group and user must all be on the allowlist.How to build this Playbook §4.4 · Policy
Rules in version control
With a default that cannot auto-approve; only the named approver's decision counts.How to build this Playbook §8 · Autonomy ladder
Approval bound to the request
An approval covers the exact request and is invalidated if the ticket is edited.How to build this Playbook §8 · Autonomy ladder
Verified completion
A request completes only after read-back verification, with no duplicate writes.How to build this Playbook §4.1 · Resilience
Append-only audit trail
Plus automated tests for every control path.How to build this Playbook §4.3 · Audit
Human in the loop

The requester confirms before a ticket is raised from chat. Any request not covered by an explicit low-risk rule waits for a named approver in ServiceNow. A change that cannot be verified is marked failed for a person to review.

Stack
PythonFastAPIServiceNow (Table API, Service Catalog API)Microsoft GraphMicrosoft Entra IDAzure AI FoundryStructured outputs (JSON schema)SQLitepytest
04 / 16 Built Azure · AWS

Outage response agent

An operations agent that works an outage from both ends: it responds when a server goes down, and it is designed to flag trouble before the server becomes unavailable.

My role

Built it: agent, rules, roster and notification tools, cloud trigger and restart path.

Problem

"Server unreachable" tickets arrive around the clock. Some are false alarms, yet each can pull an on-call engineer out of bed, and a real outage is only noticed after the service is already down. Operations teams need false alarms filtered out, real outages handled fast, and early warning before a failure.

What it does

The agent has two modes that share the same rules, policy checks, duty roster and notification tools. Reactive: when a server stops, a ticket is raised in ServiceNow and the agent picks it up, validates the server, and fixed rules sort the result into false alarm or outage. For an outage it looks up who is on duty and phones that engineer, escalating to the next person if nobody responds. On the call the engineer can press a key to restart the server; the agent then restarts it, re-checks it, resolves the ticket and calls back to confirm. Proactive: the agent is designed to watch the server's health signals, identify a potential issue and flag it to the on-duty engineer before the server becomes unavailable, using the same roster, call and ticket path.

Value

Designed to cut unnecessary after-hours callouts, shorten the time from failure to restart, and move the first warning ahead of the outage. Every default leans towards calling a person when in doubt.

Architecture at a glance6 layers · 16 components

Top to bottom, from the person using it down to data and delivery. Open a layer to see its components.

  1. ServiceNow incidents

    Tickets raised when a server stops.

    ServiceNow

    Stopped-server events

    Cloud events that raise the ticket for the reactive path.

    Amazon EventBridge · AWS Lambda

    Server health signals

    Watched in proactive mode for early warning.

    Health signals
    How to build this Playbook §4.6 · Health and telemetry
  2. Ticket push

    ServiceNow pushes the ticket number to the agent.

    ServiceNow

    Scheduled poll and follow-up

    Catches anything missed and follows up.

    n8n
    How to build this Playbook §4.1 · Resilience
  3. Token verification

    Tokens verified on the agent and on each tool.

    Keycloak
    How to build this Playbook §4.8 · Secrets and identity

    Policy checks

    Deny by default, checked before every tool call.

    Open Policy Agent (Rego)
    How to build this Playbook §4.4 · Policy
  4. Outage agent

    Respond, poll and follow-up commands over an agent-to-agent API.

    Python · LangChain-based framework
    How to build this Playbook §5.3 · A2A delegation

    Deterministic rules

    Classify operational, outage or inconclusive; unclear means outage.

    Rules
    How to build this Playbook §3 · Build principles

    Ticket-note summary

    A language model writes only the summary line of the note.

    LiteLLM gateway
  5. Duty roster

    Who is on duty, with all-or-nothing imports and a staleness flag.

    FastMCP · PostgreSQL
    How to build this Playbook §5.2 · MCP

    Notifications

    SMS, voice calls and keypress responses, with escalation.

    Azure Communication Services · Amazon Connect
    How to build this Playbook §5.1 · Tool design

    Server status and restart

    Status checks and restart for tagged servers, one attempt per incident.

    Amazon EC2
    How to build this Playbook §5.1 · Tool design
  6. Container hosting

    Agent and tools in containers with a policy sidecar.

    Azure Container Apps · Docker

    CI

    Tests and builds on every change.

    GitHub Actions
    How to build this Playbook §9 · Delivery pipeline
Go deeper
Architecture — layered view6 layers · 16 components
Outage response agent: layered architecture Layers from top to bottom: Signals, Trigger, Identity and policy, Agent and decision, Tools (MCP servers), Hosting and operations. Numbered badges on each component match the steps listed below the diagram. Components outlined in orange link to the playbook section on how that part is built. 01 SIGNALS ServiceNow incidentsServiceNow incidentsServiceNow 1 4 7 P3 Stopped-server eventsStopped-server eventsAmazon EventBridge · AWS Lambda 1 Server health signals — how to build this (Playbook §4.6 Health and telemetry)Server health signalsHealth signals↗ Playbook §4.6 P1 02 TRIGGER Ticket pushTicket pushServiceNow 2 Scheduled poll and follow-up — how to build this (Playbook §4.1 Resilience)Scheduled poll and follow-upn8n↗ Playbook §4.1 6 03 IDENTITY AND POLICY Token verification — how to build this (Playbook §4.8 Secrets and identity)Token verificationKeycloak↗ Playbook §4.8 Policy checks — how to build this (Playbook §4.4 Policy)Policy checksOpen Policy Agent (Rego)↗ Playbook §4.4 04 AGENT AND DECISION Outage agent — how to build this (Playbook §5.3 A2A delegation)Outage agentPython · LangChain-based framework↗ Playbook §5.3 2 P1 Deterministic rules — how to build this (Playbook §3 Build principles)Deterministic rulesRules↗ Playbook §3 3 P2 Ticket-note summaryTicket-note summaryLiteLLM gateway 4 05 TOOLS (MCP SERVERS) Duty roster — how to build this (Playbook §5.2 MCP)Duty rosterFastMCP · PostgreSQL↗ Playbook §5.2 5 P3 Notifications — how to build this (Playbook §5.1 Tool design)NotificationsAzure Communication Services · Amazon Connect↗ Playbook §5.1 5 6 7 P3 Server status and restart — how to build this (Playbook §5.1 Tool design)Server status and restartAmazon EC2↗ Playbook §5.1 2 7 06 HOSTING AND OPERATIONS Container hostingContainer hostingAzure Container Apps · Docker Tracing — how to build this (Playbook §6 Evals and observability)TracingLangfuse↗ Playbook §6 CI — how to build this (Playbook §9 Delivery pipeline)CIGitHub Actions↗ Playbook §9
numbered badge = flow step orange outline = opens its playbook section

FlowReactive: when a server goes down

  1. Step 1: A server stops and a ticket is raised in ServiceNow.
  2. Step 2: The agent receives the ticket and validates the server.
  3. Step 3: Rules classify the result; anything unclear is treated as an outage.
  4. Step 4: False alarm: note added, priority lowered, routed for daytime review; nobody is called.
  5. Step 5: Outage: the roster returns who is on duty; the agent sends an SMS and places a call.
  6. Step 6: No response within the time limit: the next person, then a fallback group.
  7. Step 7: On the call the engineer presses a key to restart; the agent starts the server, waits for health checks, resolves the ticket and confirms by phone.

FlowProactive: before the server is unavailable

  1. Step P1: The agent monitors the server's health signals.
  2. Step P2: It identifies a potential issue before the server is unavailable.
  3. Step P3: It flags the issue to the on-duty engineer and records it in ServiceNow, so action can be taken ahead of an outage.

ControlsGuardrails built in

Rules decide, the model only writes
Classification is deterministic; the model writes the summary line.How to build this Playbook §3 · Build principles
Policy on every tool call
Every tool call is authorised by policy, with verified caller identity.How to build this Playbook §4.4 · Policy
Bounded ticket and restart actions
The agent can never close or cancel a ticket and can resolve one only after an approved, verified restart; restart is limited to tagged servers, one attempt per incident.How to build this Playbook §8 · Autonomy ladder
Call limits
Duplicate-call protection, hourly send limits and number allow-listing.How to build this Playbook §4.2 · Limits and budgets
Contact details protected
Stripped from model output and masked in notes.How to build this Playbook §4.9 · PII and DLP
Step-by-step audit
In the ticket and in structured logs.How to build this Playbook §4.3 · Audit
Human in the loop

A restart happens only when the on-duty engineer presses the key on the call. Whenever the agent cannot reach anyone it reports "page by hand".

Stack
PythonLangChain-based agent frameworkModel Context Protocol (FastMCP)Open Policy Agent (Rego)KeycloakLangfuseLiteLLMServiceNowAzure Communication ServicesAmazon ConnectAWS LambdaAmazon EventBridgeAmazon EC2Azure Container AppsPostgreSQLFastAPIn8nGitHub ActionsDocker
05 / 16 Built Google Cloud

Workspace usage and licence-fit analyzer

Licence right-sizing for Google Workspace, with rules that decide and an AI that advises, under risk-based human approval.

My role

Built it.

This is the governed rebuild of the license right-sizing agent from the first-generation platform. How it was moved →

Problem

Organisations pay per seat for collaboration licences, but unused, suspended and lightly used accounts quietly hold premium tiers. Reviewing thousands of accounts by hand is impractical, and a single bulk "approve" hides the risky cases.

What it does

Reads users, usage and licence data through a read-only tool that replaces identities with pseudonyms. Deterministic rules classify every account; for active accounts a Gemini model suggests which tier fits, in a validated structure, with a rules fallback. Results are split into no-action, individually reviewed and batch-approved groups. It never changes a licence itself.

Value

Reviewer attention goes to admins, low-confidence and disagreeing cases; every recommendation is explainable, exportable and auditable.

Architecture at a glance5 layers · 10 components

Top to bottom, from the person using it down to data and delivery. Open a layer to see its components.

  1. Web review UI

    Reviewers approve individually or by sampled batch and export reports.

    React · Firebase Auth
  2. Authenticated API

    Every call verified.

    FastAPI
    How to build this Playbook §4.8 · Secrets and identity

    Background job

    Runs snapshots and scoring outside the request.

    Cloud Run
  3. Read-only Workspace tool

    Reads users, usage and licences; pseudonymises with a field allowlist.

    MCP
    How to build this Playbook §4.9 · PII and DLP
  4. Rules engine

    Classifies every account.

    Deterministic rules
    How to build this Playbook §3 · Build principles

    AI advisory step

    Policy check, content screening, then Gemini suggests a tier in a validated structure, with a rules fallback.

    Vertex AI Gemini · Model Armor
    How to build this Playbook §7 · Security for agents

    Review planner

    Splits results into no-action, individual review and sampled batch.

    Python
    How to build this Playbook §8 · Autonomy ladder
  5. Relational store

    Snapshots, recommendations and review state.

    Cloud SQL (PostgreSQL)

    Kill switch and rate limits

    Shared counters and a stop switch.

    Redis
    How to build this Playbook §4.5 · Kill switch and dry-run

    Tamper-evident audit store

    Hash-chained, create-only.

    Cloud Storage
    How to build this Playbook §4.3 · Audit
Go deeper
Architecture — layered view5 layers · 10 components
numbered badge = flow step orange outline = opens its playbook section

FlowHow a request moves through it

  1. Step 1: An admin requests a data snapshot.
  2. Step 2: The tool reads Workspace read-only and pseudonymises.
  3. Step 3: Rules score every user.
  4. Step 4: The model advises on tier fit per active user.
  5. Step 5: Outputs are validated; disagreements are flagged.
  6. Step 6: Reviewers approve individually or by sampled batch.
  7. Step 7: Approved rows can be marked applied; reports are exported.

ControlsGuardrails built in

Policy-as-code per tenant
Open Policy Agent decides which tenants are cleared.How to build this Playbook §4.4 · Policy
Pseudonymised inputs
With a field allowlist before anything reaches the model.How to build this Playbook §4.9 · PII and DLP
Screening fails closed
Prompt and response screening; if it can't run, the model isn't called.How to build this Playbook §7 · Security for agents
Kill switch and rate limits
Tamper-evident audit
Hash-chained, create-only audit trail and a data retention job.How to build this Playbook §4.3 · Audit
Output contract checks
Model output must match the validated structure, or the rules fallback applies.How to build this Playbook §6 · Evals and observability
Human in the loop

Every change needs a named approver. Batch approval is allowed only after a recorded random sample is opened and run warnings are acknowledged.

Stack
PythonFastAPIReactVertex AI GeminiLangGraph-based agent frameworkMCPOpen Policy AgentModel ArmorCloud RunCloud SQL (PostgreSQL)RedisCloud StorageFirebase Auth
06 / 16 Built Google Cloud

Workspace security evaluator

Automated Google Workspace security audit where rules give the verdicts and AI writes the remediation notes.

My role

Built the agent; the security baseline it checks against was written by domain specialists.

Problem

Checking a collaboration tenant against a security baseline means reading dozens of admin settings per organisational unit plus email-authentication DNS records, then writing up fixes — slow and inconsistent by hand.

What it does

A read-only tool collects settings, device and account posture and DNS records and removes identities. Deterministic rules compare each setting with a recommended baseline (and an optional client-specific target) and compute a compliance score. A Gemini model then explains how to fix failing settings and proposes verdicts for settings the rules could not decide; proposals are labelled, sent to human review and never change the score.

Value

Repeatable audits with an auditable baseline, prioritised remediation text, and exportable reports.

Architecture at a glance6 layers · 12 components

Top to bottom, from the person using it down to data and delivery. Open a layer to see its components.

  1. Web UI

    Start audits, review suggestions, export reports.

    React
  2. Authenticated API

    Every call verified.

    FastAPI
    How to build this Playbook §4.8 · Secrets and identity

    Background job

    Runs the audit outside the request.

    Cloud Run
  3. Read-only Workspace tool

    Collects settings, device and account posture and DNS records; removes identities.

    MCP
    How to build this Playbook §5.2 · MCP
  4. Baseline catalogue and readers

    Compare each setting with the recommended baseline and an optional client-specific target.

    Deterministic rules
    How to build this Playbook §3 · Build principles

    DNS checks

    Email-authentication records.

    DNS

    Compliance scoring

    The score comes from rules only.

    Python
  5. Remediation notes step

    Policy check, content screening, then Gemini explains fixes and proposes verdicts for undecided settings.

    Vertex AI Gemini · Model Armor
    How to build this Playbook §7 · Security for agents

    Validator

    Confirms verdicts and score are untouched by the model.

    Output checks
    How to build this Playbook §6 · Evals and observability
  6. Relational store

    Audits and results.

    Cloud SQL (PostgreSQL)

    Tamper-evident audit store

    Content-free, hash-chained, with the baseline version hash on each audit.

    Cloud Storage
    How to build this Playbook §4.3 · Audit

    Report export

    PDF, Word and CSV.

    PDF · DOCX · CSV
Go deeper
Architecture — layered view6 layers · 12 components
Workspace security evaluator: layered architecture Layers from top to bottom: Experience, API and jobs, Tools, Rules engine, AI notes, Data, audit and reports. Numbered badges on each component match the steps listed below the diagram. Components outlined in orange link to the playbook section on how that part is built. 01 EXPERIENCE Web UIWeb UIReact 1 6 02 API AND JOBS Authenticated API — how to build this (Playbook §4.8 Secrets and identity)Authenticated APIFastAPI↗ Playbook §4.8 1 Background jobBackground jobCloud Run 1 03 TOOLS Read-only Workspace tool — how to build this (Playbook §5.2 MCP)Read-only Workspace toolMCP↗ Playbook §5.2 2 04 RULES ENGINE Baseline catalogue and readers — how to build this (Playbook §3 Build principles)Baseline catalogue and readersDeterministic rules↗ Playbook §3 3 DNS checksDNS checksDNS 3 Compliance scoringCompliance scoringPython 3 05 AI NOTES Remediation notes step — how to build this (Playbook §7 Security for agents)Remediation notes stepVertex AI Gemini · Model Armor↗ Playbook §7 4 Validator — how to build this (Playbook §6 Evals and observability)ValidatorOutput checks↗ Playbook §6 5 06 DATA, AUDIT AND REPORTS Relational storeRelational storeCloud SQL (PostgreSQL) Tamper-evident audit store — how to build this (Playbook §4.3 Audit)Tamper-evident audit storeCloud Storage↗ Playbook §4.3 6 Report exportReport exportPDF · DOCX · CSV 6
numbered badge = flow step orange outline = opens its playbook section

FlowHow an audit moves through it

  1. Step 1: An auditor starts an audit.
  2. Step 2: The tool reads the tenant read-only.
  3. Step 3: Rules give verdicts and the score.
  4. Step 4: The model adds notes for failing and undecided settings.
  5. Step 5: The validator confirms verdicts and score are untouched.
  6. Step 6: The auditor reviews suggestions and exports the report.

ControlsGuardrails built in

Read-only, pseudonymised snapshots
Read-only scopes; identities removed before analysis.How to build this Playbook §5.1 · Tool design
Masking before the model
Field allowlist and email masking.How to build this Playbook §4.9 · PII and DLP
Screening fails closed
Kill switch and rate limits
Policy-as-code per tenant
Open Policy Agent decides which tenants are cleared.How to build this Playbook §4.4 · Policy
Versioned baseline
Each audit records the hash of the baseline it used, in a content-free, hash-chained audit trail.How to build this Playbook §4.3 · Audit
Human in the loop

Every AI verdict suggestion is flagged for human review. An administrator makes all changes; the agent changes nothing.

Stack
PythonFastAPIReactVertex AI GeminiMCPOpen Policy AgentModel ArmorCloud RunCloud SQL (PostgreSQL)RedisCloud Storage
07 / 16 Extended and hardened Azure · Kubernetes

Account monitoring agent

An agent that watches account financials, flags unusual movements, explains them, and answers questions about the data in plain language.

My role

Originally built by colleagues in another team. I led its move onto a governed agent platform, hardened it (policy, identity, supply chain), and added the rules-before-model step and the layer that keeps free text and names away from the model.

Problem

Finance and operations teams received account data as many separate files and had to find and explain unusual cost and revenue movements by hand.

What it does

The agent loads finance and operations data into one store, runs checks that flag anomalies, and explains what it can with fixed rules. Only what the rules cannot explain goes to a language model, which proposes an explanation. The result is a short brief per account with actions and questions for the account team, plus a chat where managers ask questions over the same data. Checks, rules and views are refined as the team works with it.

Value

Account teams get anomalies found and explained in one place, with the model reserved for the cases that need it. Chat answers come from a path that can only read.

Architecture at a glance6 layers · 13 components

Top to bottom, from the person using it down to data and delivery. Open a layer to see its components.

  1. Web app

    Account briefs and the chat.

    React · TypeScript
  2. API with sign-in

    Token verification on every route.

    FastAPI · Keycloak
    How to build this Playbook §4.8 · Secrets and identity
  3. Data pipeline

    Loads the latest finance and operations data.

    Python

    Monitoring agent

    Writes a brief per account.

    LangGraph
    How to build this Playbook §5.5 · Multi-agent

    Chat agent

    Answers questions over the data through a read-only path.

    LangGraph
    How to build this Playbook §5.5 · Multi-agent
  4. Anomaly checks and rules

    Flag anomalies and explain what they can before any model call.

    Deterministic rules
    How to build this Playbook §3 · Build principles

    Model explanations

    Proposes explanations only for what rules can't explain.

    LiteLLM gateway
    How to build this Playbook §5.4 · Gateway and registry
  5. Query parser

    First check on every model-written query.

    SQL parser

    Per-agent policies

    Every tool call decided by policy.

    Open Policy Agent
    How to build this Playbook §4.4 · Policy

    Free-text and name shield

    Free text and names are unreadable by the chat path.

    Database permissions
    How to build this Playbook §4.9 · PII and DLP
  6. Data store

    One store for finance and operations data, with a read-only role for chat.

    PostgreSQL
    How to build this Playbook §7 · Security for agents

    Scanned, signed images

    Built and checked in the pipeline, deployed to Kubernetes.

    GitHub Actions · Kubernetes
    How to build this Playbook §9 · Delivery pipeline
Go deeper
Architecture — layered view6 layers · 13 components
Account monitoring agent: layered architecture Layers from top to bottom: Experience, API, Pipeline and agents, Rules and model, Safeguards, Data and delivery. Numbered badges on each component match the steps listed below the diagram. Components outlined in orange link to the playbook section on how that part is built. 01 EXPERIENCE Web appWeb appReact · TypeScript 4 02 API API with sign-in — how to build this (Playbook §4.8 Secrets and identity)API with sign-inFastAPI · Keycloak↗ Playbook §4.8 03 PIPELINE AND AGENTS Data pipelineData pipelinePython 1 Monitoring agent — how to build this (Playbook §5.5 Multi-agent)Monitoring agentLangGraph↗ Playbook §5.5 4 Chat agent — how to build this (Playbook §5.5 Multi-agent)Chat agentLangGraph↗ Playbook §5.5 5 04 RULES AND MODEL Anomaly checks and rules — how to build this (Playbook §3 Build principles)Anomaly checks and rulesDeterministic rules↗ Playbook §3 2 6 Model explanations — how to build this (Playbook §5.4 Gateway and registry)Model explanationsLiteLLM gateway↗ Playbook §5.4 3 05 SAFEGUARDS Query parserQuery parserSQL parser 5 Per-agent policies — how to build this (Playbook §4.4 Policy)Per-agent policiesOpen Policy Agent↗ Playbook §4.4 5 Free-text and name shield — how to build this (Playbook §4.9 PII and DLP)Free-text and name shieldDatabase permissions↗ Playbook §4.9 06 DATA AND DELIVERY Data store — how to build this (Playbook §7 Security for agents)Data storePostgreSQL↗ Playbook §7 1 5 Tracing — how to build this (Playbook §6 Evals and observability)TracingLangfuse↗ Playbook §6 Scanned, signed images — how to build this (Playbook §9 Delivery pipeline)Scanned, signed imagesGitHub Actions · Kubernetes↗ Playbook §9
numbered badge = flow step orange outline = opens its playbook section

FlowHow a run moves through it

  1. Step 1: A run loads the latest finance and operations data.
  2. Step 2: Checks flag anomalies; rules explain what they can.
  3. Step 3: A model proposes explanations for the rest.
  4. Step 4: The monitoring agent writes a brief per account.
  5. Step 5: Managers ask follow-up questions in chat; every query is checked and read-only.
  6. Step 6: Feedback from use drives the next round of rule and feature changes.

ControlsGuardrails built in

Three safeguards on model-written queries
A query parser, a policy decision and a read-only database role, each independent.How to build this Playbook §7 · Security for agents
Per-agent policies
Open Policy Agent decides every tool call.How to build this Playbook §4.4 · Policy
Verified tokens
Names and free text kept from the model
Proposals, not changes
Explanations are stored as proposals and never applied automatically.How to build this Playbook §8 · Autonomy ladder
Supply chain
Scanned and signed container images.How to build this Playbook §9 · Delivery pipeline
Human in the loop

A person starts each run. Findings and explanations are proposals for the account team. The agent changes no financial record.

Stack
PythonFastAPILangGraphReactTypeScriptPostgreSQLAzureKubernetesOpen Policy AgentKeycloakLiteLLMLangfuseGitHub Actions
08 / 16 Co-built Kubernetes

Proposal completeness agent

Checks a draft proposal against the client's request document and shows which requirements are covered, partly covered or missing.

My role

Co-built with my team. I shaped the design and worked through the build problems the team ran into, moved it onto a governed engineering setup (pinned builds, policy tests, image scanning), and added the calibration harness used to tune it.

Problem

When a services proposal is written against a long request for proposal, individual requirements can be missed or answered only vaguely, and that is usually found late. Checking every requirement against every commitment by hand is slow and inconsistent.

What it does

A user uploads the client's request and the draft proposal. The agent pulls out what the client asks for and what the proposal commits to, matches the two, and judges each requirement as covered, partly covered or missing, with a short reason. It returns a coverage report with the gaps and with commitments nobody asked for. Extraction, matching and scoring are tuned as real documents show where it falls short.

Value

A consistent first-pass completeness check, so reviewers spend their time on the gaps.

Architecture at a glance5 layers · 11 components

Top to bottom, from the person using it down to data and delivery. Open a layer to see its components.

  1. Web app

    Upload documents and read the coverage report.

    React · TypeScript
  2. Upload API with background jobs

    Type allowlist; uploads held only for the duration of a run.

    FastAPI
    How to build this Playbook §7 · Security for agents
  3. Document parser

    Splits both documents into sections.

    Python

    Extraction

    A model pulls out requirements and commitments.

    LangGraph
    How to build this Playbook §3 · Build principles

    Similarity matching

    Pairs each requirement with likely commitments.

    Text embeddings · FAISS

    Pair judge

    A model judges each pair and explains its verdict; output validated against allowed values.

    LangGraph
    How to build this Playbook §6 · Evals and observability
  4. Private model gateway

    All model calls go through it.

    LiteLLM
    How to build this Playbook §5.4 · Gateway and registry

    Coverage report

    Code builds covered, partial, missing and unrequested commitments.

    Python
  5. Calibration harness

    Tunes extraction, matching and scoring against real documents.

    Python
    How to build this Playbook §6 · Evals and observability

    Governed build

    Pinned builds, policy tests and image scanning.

    Docker · Kubernetes · GitHub Actions · Open Policy Agent
    How to build this Playbook §9 · Delivery pipeline
Go deeper
Architecture — layered view5 layers · 11 components
Proposal completeness agent: layered architecture Layers from top to bottom: Experience, API, Validation pipeline (fixed order), Models and report, Operations. Numbered badges on each component match the steps listed below the diagram. Components outlined in orange link to the playbook section on how that part is built. 01 EXPERIENCE Web appWeb appReact · TypeScript 1 02 API Upload API with background jobs — how to build this (Playbook §7 Security for agents)Upload API with background jobsFastAPI↗ Playbook §7 1 03 VALIDATION PIPELINE (FIXED ORDER) Document parserDocument parserPython 2 Extraction — how to build this (Playbook §3 Build principles)ExtractionLangGraph↗ Playbook §3 3 Similarity matchingSimilarity matchingText embeddings · FAISS 4 Pair judge — how to build this (Playbook §6 Evals and observability)Pair judgeLangGraph↗ Playbook §6 5 04 MODELS AND REPORT Private model gateway — how to build this (Playbook §5.4 Gateway and registry)Private model gatewayLiteLLM↗ Playbook §5.4 3 5 Coverage reportCoverage reportPython 6 05 OPERATIONS Tracing — how to build this (Playbook §6 Evals and observability)TracingLangfuse↗ Playbook §6 Calibration harness — how to build this (Playbook §6 Evals and observability)Calibration harnessPython↗ Playbook §6 7 Governed build — how to build this (Playbook §9 Delivery pipeline)Governed buildDocker · Kubernetes · GitHub Actions · Open PolicyAgent↗ Playbook §9
numbered badge = flow step orange outline = opens its playbook section

FlowHow a check moves through it

  1. Step 1: Upload the request document and the draft proposal.
  2. Step 2: The documents are parsed into sections.
  3. Step 3: A model extracts requirements and commitments.
  4. Step 4: Similarity search pairs each requirement with likely commitments.
  5. Step 5: A model judges each pair and explains its verdict.
  6. Step 6: Code builds the coverage report: covered, partial, missing, and unrequested commitments.
  7. Step 7: Results from use feed the next round of tuning.

ControlsGuardrails built in

Fixed step order
The model cannot skip or reorder steps.How to build this Playbook §3 · Build principles
Validated model output
Verdicts must be one of the allowed values; scoring and classification are done by code.How to build this Playbook §6 · Evals and observability
Private gateway
All model calls go through a private gateway.How to build this Playbook §5.4 · Gateway and registry
Upload hygiene
Upload type allowlist; uploads held only for the duration of a run.How to build this Playbook §7 · Security for agents
Human in the loop

The agent recommends only. It never marks a proposal as ready; a reviewer reads the findings and decides what to change.

Stack
PythonFastAPIReactTypeScriptLangGraphLiteLLMText embeddingsFAISSLangfuseOpen Policy AgentDockerKubernetesGitHub Actions
09 / 16 Built Google Cloud

Reseller client-book assistant

Ask-the-book assistant for a Google Workspace reseller: the model picks the filters, code computes every number.

My role

Built it.

Problem

Partner teams need quick answers on renewals, seats and subscription status across a whole client portfolio, but the underlying platform holds active paid subscriptions, so nothing may ever be changed and numbers must be exact.

What it does

A read-only tool collects the subscription book. Rules normalise it and break down purchased, assigned and unassigned seats. For a natural-language question, a Gemini model first returns only structured query filters; a deterministic engine filters, counts and totals; the model then words a short answer over a capped result in which client names are replaced by tokens. The on-screen table comes from the computed result.

Value

Fast portfolio answers with no arithmetic by the model, no client names sent to the model, and no write path to the reseller platform.

Architecture at a glance5 layers · 11 components

Top to bottom, from the person using it down to data and delivery. Open a layer to see its components.

  1. Web UI

    Ask questions; see the applied filters and the computed table.

    React
  2. Authenticated API

    Every call verified.

    FastAPI
    How to build this Playbook §4.8 · Secrets and identity
  3. Read-only collection tool

    Collects the subscription book with a GET-only transport.

    MCP · Reseller API (read-only)
    How to build this Playbook §5.1 · Tool design

    Snapshots

    Normalised book, with retention and confirmed purge.

    Cloud SQL (PostgreSQL)
  4. Client-name tokeniser

    Replaces client names with tokens before the model.

    Python
    How to build this Playbook §4.9 · PII and DLP

    Planning step

    Gemini returns only structured query filters.

    Vertex AI Gemini · structured output
    How to build this Playbook §3 · Build principles

    Deterministic query engine

    Filters, counts and totals; the model does no arithmetic.

    Python

    Narration step

    Gemini words a short answer over a capped, tokenised sample.

    Vertex AI Gemini
  5. Screening

    Prompt, payload and answer screening, failing closed.

    Model Armor
    How to build this Playbook §7 · Security for agents

    Rate limits and kill switch

    Per-user limits and a stop switch.

    Redis
    How to build this Playbook §4.2 · Limits and budgets

    Audit trail

    Hash-chained, with hashed content.

    Create-only storage
    How to build this Playbook §4.3 · Audit
Go deeper
Architecture — layered view5 layers · 11 components
numbered badge = flow step orange outline = opens its playbook section

FlowHow a question moves through it

  1. Step 1: Staff refresh the book (read-only).
  2. Step 2: Staff ask a question.
  3. Step 3: Client names are tokenised.
  4. Step 4: The model proposes filters.
  5. Step 5: Code computes the result.
  6. Step 6: The model narrates; names are restored in the browser.
  7. Step 7: Every read and question is audited.

ControlsGuardrails built in

No write path
Read-only scope and a GET-only transport, with an automated test that forbids any write scope.How to build this Playbook §5.1 · Tool design
Policy-as-code clearance
Per environment, with Open Policy Agent.How to build this Playbook §4.4 · Policy
Screening fails closed
Rate limits and kill switch
Hash-chained audit
With hashed content; snapshot retention and confirmed purge.How to build this Playbook §4.3 · Audit
Human in the loop

The assistant informs only. The applied filters are shown so staff can verify how the question was interpreted.

Stack
PythonFastAPIReactVertex AI GeminiStructured outputMCPGoogle Workspace Reseller API (read-only)Open Policy AgentModel ArmorCloud RunCloud SQL (PostgreSQL)Redis
10 / 16 Built Google Cloud

Support-ticket enrichment

AI triage drafts for a Google Workspace support desk — summary, problem statement and ranked next steps, always reviewed by an engineer.

My role

Built it.

Problem

Engineers lose time reading long ticket histories before they can act, and customer tickets contain personal details that should not be sent to a model or posted back unreviewed.

What it does

Reads each ticket through a read-only tool, replaces names, email addresses and phone numbers with placeholders, and asks a Gemini model for a summary, a one-sentence problem statement and two to four ranked candidate fixes with confidence and rationale. Placeholders are restored for the reviewer. Each draft enters a review queue where an engineer approves (optionally editing) or rejects it. A background job enriches new open tickets and produces a digest.

Value

Faster first read of a ticket, consistent triage notes, and personal data kept away from the model.

Architecture at a glance5 layers · 10 components

Top to bottom, from the person using it down to data and delivery. Open a layer to see its components.

  1. Review queue UI

    Engineers approve, edit or reject each draft.

    React
  2. Authenticated API

    Every call verified.

    FastAPI
    How to build this Playbook §4.8 · Secrets and identity

    Read-only ticket tool

    Fetches tickets; posting disabled by default.

    MCP · Jira (read-only)
    How to build this Playbook §5.1 · Tool design
  3. Identity placeholders

    Names, emails and phone numbers replaced before the model; fails closed.

    Sensitive Data Protection (DLP)
    How to build this Playbook §4.9 · PII and DLP

    Prompt and answer screening

    Screens both directions.

    Model Armor
    How to build this Playbook §7 · Security for agents
  4. Structured enrichment

    Summary, problem statement and two to four ranked fixes with confidence.

    Vertex AI Gemini · structured output

    Placeholder restore

    Puts identities back for the reviewer only.

    Python
  5. Review queue

    Every enrichment is a draft until a named reviewer acts.

    Cloud SQL (PostgreSQL)
    How to build this Playbook §8 · Autonomy ladder

    Background digest

    Enriches new open tickets and produces a digest.

    Cloud Run job

    Audit trail

    Without ticket content, plus a retention job.

    Create-only storage
    How to build this Playbook §4.3 · Audit
Go deeper
Architecture — layered view5 layers · 10 components
Support-ticket enrichment: layered architecture Layers from top to bottom: Experience, API and tools, Privacy and screening, Model, Data. Numbered badges on each component match the steps listed below the diagram. Components outlined in orange link to the playbook section on how that part is built. 01 EXPERIENCE Review queue UIReview queue UIReact 7 02 API AND TOOLS Authenticated API — how to build this (Playbook §4.8 Secrets and identity)Authenticated APIFastAPI↗ Playbook §4.8 Read-only ticket tool — how to build this (Playbook §5.1 Tool design)Read-only ticket toolMCP · Jira (read-only)↗ Playbook §5.1 1 03 PRIVACY AND SCREENING Identity placeholders — how to build this (Playbook §4.9 PII and DLP)Identity placeholdersSensitive Data Protection (DLP)↗ Playbook §4.9 2 Prompt and answer screening — how to build this (Playbook §7 Security for agents)Prompt and answer screeningModel Armor↗ Playbook §7 3 5 04 MODEL Structured enrichmentStructured enrichmentVertex AI Gemini · structured output 4 Placeholder restorePlaceholder restorePython 5 05 DATA Review queue — how to build this (Playbook §8 Autonomy ladder)Review queueCloud SQL (PostgreSQL)↗ Playbook §8 6 Background digestBackground digestCloud Run job Audit trail — how to build this (Playbook §4.3 Audit)Audit trailCreate-only storage↗ Playbook §4.3 7
numbered badge = flow step orange outline = opens its playbook section

FlowHow a ticket moves through it

  1. Step 1: The ticket is fetched read-only.
  2. Step 2: Identities are replaced.
  3. Step 3: The prompt is screened.
  4. Step 4: The model drafts the enrichment.
  5. Step 5: The answer is validated and screened.
  6. Step 6: The draft is queued for review.
  7. Step 7: An engineer approves, edits or rejects it.

ControlsGuardrails built in

Read-only ticket access
Pseudonymisation fails closed
If identities can't all be replaced, the ticket isn't sent.How to build this Playbook §4.9 · PII and DLP
Prompt and response screening
Policy-as-code clearance per desk
Open Policy Agent decides which desks are cleared.How to build this Playbook §4.4 · Policy
Kill switch and rate limits
Content-free audit
Audit trail without ticket content, plus a retention job.How to build this Playbook §4.3 · Audit
Human in the loop

Every enrichment is a draft. A named reviewer approves or rejects it, and only approved text could ever be posted.

Stack
PythonFastAPIReactVertex AI GeminiSensitive Data Protection (DLP)Model ArmorMCPJira (read-only)Open Policy AgentCloud RunCloud SQL (PostgreSQL)Redis
11 / 16 Co-built Microsoft stack

RevokAI — Governed Access Control

A governed AI compliance control for access revocation: AI correlates, rules and a human decide, and every action is evidenced.

Problem

Access-revocation compliance controls rely on manual analysis. The hardest step is matching people who have left to the accounts they still hold, because the identifiers often sit in metadata and free text where a standard report can't join them. That matching is slow human work, and the control costs roughly 25 hours a week to run manually.

What it does

RevokAI turns the manual control into a closed loop with five stages: detect, validate, approve, remediate, prove. An AI agent matches leavers to accounts even where the match is buried in metadata or free text. Fixed rules apply the revocation deadline (SLA), and each exception ends up in a named outcome. A human approves every remediation action. Every action is ticketed and timestamped, and each run produces an audit trail that can be exported. I co-built RevokAI in a sponsored squad, contributing the agent workflow and its run outputs.

Value

It is designed to turn an access-revocation control from a weekly manual grind into an on-demand run that takes minutes and produces its own audit trail. It targets the roughly 25 hours a week (about 1,300 hours a year) that the control costs to run manually today. That figure is the current manual cost, not a measured saving. The same pattern (AI reasons, fixed rules decide, humans approve the action) carries over to other controls such as access recertification.

Architecture at a glance5 layers · 7 components

Top to bottom, from the person using it down to data and delivery. Open a layer to see its components.

  1. Leaver and account records

    The control's source data: people who have left and the accounts that may still be active. The identifiers are often held in metadata and free-text fields rather than clean keys.

    Source records
  2. Identity-matching agent

    Uses AI to match leavers to accounts where no clean join exists. This is the step a standard report can't do.

    Microsoft Copilot Studio
    How to build this Playbook §2 · Reference architecture
  3. Fixed SLA rules

    Apply the revocation deadline with fixed rules, so the compliance decision doesn't depend on what the model generates.

    Deterministic rules
    How to build this Playbook §3 · Build principles

    Human approval gate

    A person must approve every remediation action before it goes ahead. This was built in from day one.

    Approval step in the workflow
    How to build this Playbook §8 · Autonomy ladder
  4. Workflow automation

    Runs the closed loop from detection through to evidence.

    Power Automate · Office Scripts
    How to build this Playbook §2 · Reference architecture
  5. Remediation tickets

    Each approved action is raised as a remediation ticket, which is how it is tracked through to closure.

    Ticket generation

    Exportable audit trail

    Every action is timestamped and assembled into audit evidence that the control owner and auditors can export.

    Audit evidence output
    How to build this Playbook §4.3 · Audit
Go deeper
Architecture — layered view5 layers · 7 components
RevokAI — Governed Access Control: layered architecture Layers from top to bottom: Inputs, Reasoning, Deciding, Orchestration, Action and evidence. Numbered arrows follow the key flow listed below the diagram. Components outlined in orange link to the playbook section on how that part is built. Leaver and account recordsLeaver and accountrecordsSource records Identity-matching agent — how to build this (Playbook §2 Reference architecture)Identity-matching agentMicrosoft Copilot Studio↗ Playbook §2 Fixed SLA rules — how to build this (Playbook §3 Build principles)Fixed SLA rulesDeterministic rules↗ Playbook §3 Human approval gate — how to build this (Playbook §8 Autonomy ladder)Human approval gateApproval step in the workflow↗ Playbook §8 Workflow automation — how to build this (Playbook §2 Reference architecture)Workflow automationPower Automate · Office Scripts↗ Playbook §2 Remediation ticketsRemediation ticketsTicket generation Exportable audit trail — how to build this (Playbook §4.3 Audit)Exportable audit trailAudit evidence output↗ Playbook §4.3 01 INPUTS 02 REASONING 03 DECIDING 04 ORCHESTRATION 05 ACTION AND EVIDENCE 2 3 5 6 7 1 4
numbered arrow = flow step orange outline = opens its playbook section dashed = deploy or check path

FlowHow a request moves through it

  1. Step 1: Detect: the loop takes in leaver records and the account data to check them against.
  2. Step 2: Validate (AI): the matching agent links leavers to accounts where identifiers are buried in metadata or free text.
  3. Step 3: Validate (rules): fixed rules apply the revocation deadline.
  4. Step 4: Validate (outcome): each exception lands in a named outcome: breach, within SLA, compliant, or for review.
  5. Step 5: Approve: a human reviews each proposed remediation. Nothing goes ahead without approval.
  6. Step 6: Remediate: each approved action is raised as a remediation ticket.
  7. Step 7: Prove: every action is ticketed and timestamped, and the run is compiled into an audit trail that can be exported as control evidence.

ControlsGuardrails built in

AI reasons; rules and humans decide
AI handles the hard identity matching. Fixed rules apply the deadline and a human approves the action, so the outcome isn't left to the model.How to build this Playbook §3 · Build principles
Mandatory human approval
Every remediation action needs a person's approval. No action is autonomous.How to build this Playbook §8 · Autonomy ladder
Exportable audit evidence
Every action is ticketed and timestamped, and the run produces an audit trail that can be exported.How to build this Playbook §4.3 · Audit
Human in the loop

Every remediation action is approved by a human. Approval was built into the loop from day one, so no remediation runs without a person signing it off.

Stack
Microsoft Copilot StudioPower AutomateOffice Scripts
12 / 16 Vertex AI

Customer Outreach Agent

Evidence-gated customer outreach: research, score, then draft, with a human reviewing every message.

Problem

Researching an account properly before reaching out takes hours per customer. You have to work out its current strategic priorities and which services actually fit them. Without that research, outreach at scale turns into generic, low-relevance messages.

What it does

For each target account, the agent researches the customer's current strategic priorities using real-time web search, maps them to a service portfolio, and scores the fit out of 100. Only opportunities scoring 80 or above go on to drafting. For those, the agent writes personalized outreach grounded in the customer's actual goals, and a human reviews every draft before anything reaches a customer. Research, scoring and drafting run end to end from a single command. I designed and built it.

Value

It replaces hours of manual research per account with one command. Each message rests on current research into that customer rather than a template. Because of the 80/100 evidence gate, no draft is written unless the research supports the opportunity.

Architecture at a glance5 layers · 7 components

Top to bottom, from the person using it down to data and delivery. Open a layer to see its components.

  1. Single-command run

    Starts the full research, score and draft sequence for the target accounts.

    One-command trigger
  2. Real-time research step

    Researches each customer's current strategic priorities using real-time web search, so the analysis draws on current public information.

    Real-time web search
    How to build this Playbook §5.1 · Tool design
  3. Portfolio mapping

    Maps the priorities it found to the offerings in a service portfolio.

    Vertex AI (Gemini)
    How to build this Playbook §2 · Reference architecture

    Alignment scoring

    Scores how well the customer's priorities fit the portfolio, on a scale of 0 to 100.

    Scoring engine

    80/100 evidence gate

    Only opportunities scoring 80 or above go forward. Anything below produces no draft.

    Threshold rule
    How to build this Playbook §4.4 · Policy
  4. Personalized draft generator

    Writes outreach grounded in that customer's researched goals, only for opportunities that pass the gate.

    Vertex AI (Gemini)
  5. Mandatory draft review

    A person reviews every draft, and nothing reaches a customer without that review.

    Human review step
    How to build this Playbook §8 · Autonomy ladder
Go deeper
Architecture — layered view5 layers · 7 components
Customer Outreach Agent: layered architecture Layers from top to bottom: Trigger, Research, Reasoning and scoring, Generation, Human review. Numbered arrows follow the key flow listed below the diagram. Components outlined in orange link to the playbook section on how that part is built. Single-command runSingle-command runOne-command trigger Real-time research step — how to build this (Playbook §5.1 Tool design)Real-time research stepReal-time web search↗ Playbook §5.1 Portfolio mapping — how to build this (Playbook §2 Reference architecture)Portfolio mappingVertex AI (Gemini)↗ Playbook §2 Alignment scoringAlignment scoringScoring engine 80/100 evidence gate — how to build this (Playbook §4.4 Policy)80/100 evidence gateThreshold rule↗ Playbook §4.4 Personalized draft generatorPersonalized draftgeneratorVertex AI (Gemini) Mandatory draft review — how to build this (Playbook §8 Autonomy ladder)Mandatory draft reviewHuman review step↗ Playbook §8 01 TRIGGER 02 RESEARCH 03 REASONING AND SCORING 04 GENERATION 05 HUMAN REVIEW 2 3 4 5 6 ≥ 80 7 1
numbered arrow = flow step orange outline = opens its playbook section dashed = deploy or check path

FlowHow a request moves through it

  1. Step 1: A single command starts a run over the target accounts.
  2. Step 2: For each account, the agent researches the customer's current strategic priorities using real-time web search.
  3. Step 3: It maps those priorities to the service portfolio.
  4. Step 4: It scores the fit out of 100.
  5. Step 5: Gate: below 80, the opportunity stops and no draft is created. At 80 or above, it moves on.
  6. Step 6: The agent drafts personalized outreach grounded in the researched priorities.
  7. Step 7: A human reviews every draft before any outreach reaches the customer.

ControlsGuardrails built in

80/100 evidence threshold
A strict fit score gates every opportunity. If the research doesn't support it, no email is ever drafted.How to build this Playbook §4.4 · Policy
Mandatory human review
A person reviews every draft before anything reaches a customer. The agent drafts, and a human decides what gets sent.How to build this Playbook §8 · Autonomy ladder
Research-first sequencing
Research and scoring happen in a fixed order before any text is written, so drafts are generated only for opportunities backed by current research into that customer's goals.How to build this Playbook §3 · Build principles
Human in the loop

A human reviews every outreach draft, and nothing reaches a customer without that review. The 80/100 gate also stops weakly supported opportunities before a draft exists, so reviewers only see opportunities the research supports.

Stack
Google Cloud Vertex AIGeminiReal-time web search
13 / 16 Led and built Case study

Case study: moving earlier agents onto the governed platform

Moving working AI agents onto a governed platform without losing a single business rule.

My role

Led and built the migration and its fidelity contract.

The original single-service implementation is described further down this page. First-generation platform →

Problem

A set of AI agents had proven their value in an early single-service implementation, with rules written by domain specialists. Rebuilding them on a governed platform (new framework, new database, new identity model) risked quietly dropping or weakening those rules.

What it does

Each agent was rebuilt as a self-contained service with its rule code carried over unchanged and only its inputs and outputs replaced. An automated "fidelity contract" compares the new code with a frozen copy of the original: methodology files must match byte for byte, rule code must match at syntax-tree level except for an explicit list of declared swaps, and user pages may differ only by declared edits. Privacy improvements added on top (pseudonymisation) are proven not to change any result. The contract runs on every change.

Value

The specialists' rules stay the single audited baseline; every deviation is visible and reviewed; the original implementation could be switched off with confidence.

Architecture at a glance4 layers · 6 components

Top to bottom, from the person using it down to data and delivery. Open a layer to see its components.

  1. Frozen reference copy

    The original rule files and pages the checks need.

    Version control
  2. Self-contained agent projects

    Rule code copied verbatim; only data access replaced.

    Agent framework with policy enforcement
    How to build this Playbook §4.4 · Policy
  3. Fidelity contract

    Byte comparison, syntax-tree comparison and declared-swap lists.

    Python AST · pytest
    How to build this Playbook §9 · Delivery pipeline

    Equivalence contract

    Same scores on raw and pseudonymised data.

    pytest
    How to build this Playbook §6 · Evals and observability

    No-write test

    Write paths not carried over, banned by a repository-wide test.

    pytest
    How to build this Playbook §7 · Security for agents
  4. Required check

    The contract must pass before merge.

    GitHub Actions
    How to build this Playbook §9 · Delivery pipeline
Go deeper
Architecture — layered view4 layers · 6 components
Case study: moving earlier agents onto the governed platform: layered architecture Layers from top to bottom: Source of truth, Rebuilt agents, Contracts, CI. Numbered badges on each component match the steps listed below the diagram. Components outlined in orange link to the playbook section on how that part is built. 01 SOURCE OF TRUTH Frozen reference copyFrozen reference copyVersion control 1 02 REBUILT AGENTS Self-contained agent projects — how to build this (Playbook §4.4 Policy)Self-contained agent projectsAgent framework with policy enforcement↗ Playbook §4.4 2 6 03 CONTRACTS Fidelity contract — how to build this (Playbook §9 Delivery pipeline)Fidelity contractPython AST · pytest↗ Playbook §9 3 4 Equivalence contract — how to build this (Playbook §6 Evals and observability)Equivalence contractpytest↗ Playbook §6 5 No-write test — how to build this (Playbook §7 Security for agents)No-write testpytest↗ Playbook §7 6 04 CI Required check — how to build this (Playbook §9 Delivery pipeline)Required checkGitHub Actions↗ Playbook §9 4
numbered badge = flow step orange outline = opens its playbook section

FlowHow the migration worked

  1. Step 1: Freeze the original files the checks need.
  2. Step 2: Copy rule code verbatim into the new project; replace only data access.
  3. Step 3: Declare each replacement by name in the contract.
  4. Step 4: Run byte and syntax-tree comparisons on every change.
  5. Step 5: Prove that added privacy steps leave results identical.
  6. Step 6: Switch users to the new platform, then remove the original.

ControlsGuardrails built in

Required fidelity check
Against a frozen reference, on every change.How to build this Playbook §9 · Delivery pipeline
Explicit deviation lists
Every intended difference is declared and reviewable.How to build this Playbook §8 · Autonomy ladder
Result-equivalence test
Privacy steps proven not to change any score.How to build this Playbook §6 · Evals and observability
No write paths
Write paths not carried over and banned by a repository-wide test.How to build this Playbook §7 · Security for agents
Human in the loop

Any intended change from the original behaviour is an owner decision, recorded and declared in the contract before it can pass.

Stack
PythonAbstract syntax tree comparisonpytestGitHub ActionsOpen Policy AgentGoogle Cloud RunCloud SQL (PostgreSQL)Vertex AIOpenBaoLiteLLMLangfuse
14 / 16 First generation

Multi-Agent AI Platform — first generation

One governed foundation on Google Cloud that gives specialist AI agents shared sign-in, data-tier separation, central model management, audit logging and a tested, region-only deploy path.

Built on this foundation

The change management and infra health check agents below run on this platform, and so did the first version of the license right-sizing agent before it was rebuilt on the governed Google Workspace agent platform (see the migration case study above). Each one is its own module in the shared backend, so it starts with the platform's sign-in, central model registry and one-command deploy path, and adds its own domain logic. What each one takes from the platform:

Problem

Consulting and operations work (change programs, license reviews, infrastructure health checks, security reviews) was done by hand, and quality varied from one practitioner to the next. Each AI experiment had to solve sign-in, data separation, model choice, audit and deployment again from scratch. On top of that, a strict organization policy banned multi-region cloud resources, which broke the default container registry and build path.

What it does

I built it end to end. It hosts many specialist AI agents behind one serverless backend on Google Cloud Run. Each agent is its own module (a FastAPI "router") inside one shared Python service. The browser reaches it through Firebase Hosting, which forwards API calls to the backend, so web pages never hold a backend address. Agents draw on shared building blocks:

  • Google sign-in, verified on the server.
  • One allowlist of who may use the platform, which denies access if it can't be read.
  • Two data-access tiers on the agents wired to them: real customer data only for verified users on an allowed domain, and a synthetic sample dataset for everyone else.
  • A central registry that sets each agent's AI model. Admins can change it at runtime, and it blocks models served outside approved regions.
  • A weekly model-lifecycle steward that keeps agents off retired models.
  • A tracked background-job pattern for long analyses.
  • A one-command, region-only deploy with a test gate and quick rollback.

An opt-in governance framework (kill switch, tamper-evident audit trail, shared rate limits, reversible masking of customer identifiers, and autonomy rules) was built from composable building blocks. It was first adopted by the agent that handles the most sensitive data.

Value

Building a new agent mostly means writing its domain logic, because sign-in, admission control, model management, audit logging and a tested deploy path are already there to plug into. Admins see a countdown before a model they rely on is retired. If a registry-managed agent's model disappears, the next weekly run moves it to a same-tier replacement. The serverless runtime scales to zero when idle, builds stay in approved regions, and admins can only pick models served in those regions.

Architecture at a glance9 layers · 27 components

Top to bottom, from the person using it down to data and delivery. Open a layer to see its components.

  1. Agent workspace pages

    One single-page UI per agent, launched from a home page of tiles. Admin-only tiles are hidden from non-admins.

    React 18 (pinned CDN builds), Firebase Hosting
    How to build this Playbook §2 · Reference architecture

    Shared sign-in module

    Two sign-in paths. Allowed-domain users sign in with Google and get a verified sign-in token. Other allowlisted users are admitted to the restricted tier, which only sees synthetic sample data. Every API call carries the cached token.

    Firebase Authentication JS SDK (pinned)
    How to build this Playbook §4.8 · Secrets and identity

    Admin console

    Manage allowlisted emails and domains, platform admins and per-agent admins. Choose each agent's model and review the model-lifecycle steward's run history.

    React, admin API
    How to build this Playbook §4.4 · Policy
  2. Hosting rewrite proxy

    Serves the static pages and forwards every API path to the backend service, so the frontend uses relative URLs only and holds no backend address. HTML and JavaScript are served uncached, so users always get the latest build.

    Firebase Hosting rewrites
    How to build this Playbook §2 · Reference architecture
  3. Request authentication check

    On routes that require authentication, checks the sign-in token's signature, expiry, audience and issuer. It then works out the user's identity, data tier and admin rights.

    Firebase Admin SDK, FastAPI dependency
    How to build this Playbook §4.8 · Secrets and identity

    Access-control allowlist

    The single source of truth for who may use the platform (emails, domains, admins, per-agent admins). It is cached briefly, and a failed lookup denies access. A bootstrap admin prevents lockout, and the last admin cannot be removed.

    Firestore
    How to build this Playbook §4.4 · Policy

    Data-access tiers

    The full tier is granted only from a verified token on an allowed domain. On agents wired to the tier helpers, restricted users see only the synthetic sample tenant or records explicitly marked as containing no customer data. Untagged records count as customer data and are hidden, and totals are filtered before they are calculated.

    Python policy helpers
    How to build this Playbook §4.7 · Multi-tenancy
  4. Agent routers

    Each agent ships as a core module plus its own API router, mounted into one FastAPI app.

    FastAPI on Cloud Run
    How to build this Playbook §2 · Reference architecture

    Health and readiness probes

    A lightweight heartbeat that needs no sign-in, plus a readiness probe that tests the datastore, reports the sign-in mode, and returns a 'degraded' status naming the failing check.

    FastAPI
    How to build this Playbook §4.6 · Health and telemetry

    Untrusted-input pipeline

    Used by the infrastructure report analyzers and by the most sensitive agent. It applies size limits, strips control characters, redacts secrets and card numbers, flags likely prompt injection, wraps input so the model treats it as data rather than instructions, and writes an audit event whenever something is flagged.

    Python
    How to build this Playbook §7 · Security for agents

    Per-user rate limiter

    Simple sliding-window limits on expensive actions such as uploads, chats and job launches. Counts are kept per server instance. The governed agent uses shared counters instead.

    Python (in-process)
    How to build this Playbook §4.2 · Limits and budgets
  5. Governed-agent base class

    An agent inherits an ordered stack of composable building blocks: input security, audit masking, tamper-evident audit, tenancy, rate limits, PII handling, kill switch and governance. One shared guard on every route runs the governance check, then the access check, then the rate limit.

    Python mixins
    How to build this Playbook §4 · Control stack

    Autonomy policy check

    Runs on each guarded call. It checks the kill switch, then consults a rule table that weighs how widely the agent operates against how much autonomy it has (fully autonomous operation is never allowed), then issues a recertification warning if needed, then records the allow or deny in an in-memory decision log.

    Python
    How to build this Playbook §8 · Autonomy ladder

    Kill switch

    Stops the governed agent without a deploy, using a datastore toggle with an environment-setting backstop. It is checked before any model call or credential use. A kill that is already in force survives a datastore outage, and the job path that would use a write-capable credential refuses to run if the switch state can't be read.

    Firestore toggle + environment setting
    How to build this Playbook §4.5 · Kill switch and dry-run

    Tamper-evident audit trail

    Each audit entry includes a fingerprint (hash) of the previous entry. The chain advances inside a datastore transaction, so it stays in one order across server instances, and an integrity check over recent entries reports which entry was broken or altered. The chain is not yet anchored outside the system.

    SHA-256 hash chain, Firestore transactions
    How to build this Playbook §4.3 · Audit

    Shared rate limiter

    Per-user and per-action limits (per-tenant limits are available) on counters shared across server instances. Over the limit, the API returns a 'too many requests' response.

    Firestore transactional counters
    How to build this Playbook §4.2 · Limits and budgets

    PII pseudonymization

    Replaces customer identifiers with stable placeholder tokens before the model sees them. The token map goes only to the user's screen, so real names are restored for display only.

    Python
    How to build this Playbook §4.9 · PII and DLP
  6. Central model registry

    Decides each registry-managed agent's model in a fixed order: environment override, then admin choice, then baseline. Admin choices are rejected if the runtime is unsupported or the model is served outside the approved regions, unless governance turns that on. If the datastore fails, the agent falls back to its baseline model instead of breaking.

    Python, Firestore
    How to build this Playbook §2 · Reference architecture

    Model-lifecycle steward

    A weekly scheduled run that test-calls every registry model in use. It switches an agent automatically only when its model returns not-found, and applies a same-tier upgrade only after a successful test call. Changes that move a model to a different tier go to admins as recommendations. It also tracks blocked successors and a retirement countdown, supports a dry run, and audit-logs every change so it can be reverted.

    Cloud Scheduler, Vertex AI Gemini with Search grounding
    How to build this Playbook §2 · Reference architecture

    LLM usage and cost ledger

    Instrumented agents write usage records: tokens, call count and cost from a price catalog. It is built so that it can never break the agent it measures.

    Firestore
    How to build this Playbook §10 · Scaling and cost

    Gemini on Vertex AI

    AI model inference for the agents.

    Vertex AI
  7. Async job tracker

    Long analyses return a job ID immediately, and the UI polls a status record that moves through pending, running, completed and failed. The longest-running agents also mark stalled jobs as failed so the UI doesn't poll forever.

    Firestore
    How to build this Playbook §4.1 · Resilience

    Async job worker

    For the longest-running agents, work runs as a Cloud Run Job built from the same container image, with runs of up to an hour. That way it doesn't depend on the web service staying awake. An in-process fallback covers local development.

    Cloud Run Jobs
    How to build this Playbook §10 · Scaling and cost
  8. Operational datastore

    Holds agent runs and projects, job state, the allowlist, model overrides, the audit chain, rate counters and chat history.

    Firestore

    Structured audit log

    JSON audit lines for admin changes, access denials, flagged inputs and steward actions. Known sensitive fields are redacted by name before logging.

    Cloud Logging
    How to build this Playbook §4.3 · Audit
  9. One-command deploy pipeline

    Runs a containment-test gate that stops the deploy on failure. It then checks the required cloud APIs (safe to re-run), verifies region-only build infrastructure, discovers files automatically with an exclusion list, runs a syntax check before the build, builds the image regionally, deploys the service and worker jobs, writes a deploy manifest, runs a post-deploy health check and optionally deploys hosting.

    Bash, Cloud Build, Artifact Registry, Cloud Run
    How to build this Playbook §9 · Delivery pipeline

    Smoke test and revision rollback

    A separate end-to-end check against the deployed service using a freshly issued sign-in token. Traffic can be rolled back to a previous revision in seconds.

    Bash, Cloud Run revisions
    How to build this Playbook §9 · Delivery pipeline
Go deeper
Architecture — layered view9 layers · 27 components
Multi-Agent AI Platform: layered architecture Layers from top to bottom: Experience, Edge, Identity and access, API and orchestration, Governance framework, Model access, Async execution, Data and evidence, Delivery. Numbered arrows follow the key flow listed below the diagram. Components outlined in orange link to the playbook section on how that part is built. Shared sign-in module — how to build this (Playbook §4.8 Secrets and identity)Shared sign-in moduleFirebase Authentication JS SDK(pinned)↗ Playbook §4.8 Admin console — how to build this (Playbook §4.4 Policy)Admin consoleReact, admin API↗ Playbook §4.4 Agent workspace pages — how to build this (Playbook §2 Reference architecture)Agent workspace pagesReact 18 (pinned CDN builds),Firebase Hosting↗ Playbook §2 Hosting rewrite proxy — how to build this (Playbook §2 Reference architecture)Hosting rewrite proxyFirebase Hosting rewrites↗ Playbook §2 Request authentication check — how to build this (Playbook §4.8 Secrets and identity)Request authenticationcheckFirebase Admin SDK, FastAPIdependency↗ Playbook §4.8 Access-control allowlist — how to build this (Playbook §4.4 Policy)Access-control allowlistFirestore↗ Playbook §4.4 Data-access tiers — how to build this (Playbook §4.7 Multi-tenancy)Data-access tiersPython policy helpers↗ Playbook §4.7 Agent routers — how to build this (Playbook §2 Reference architecture)Agent routersFastAPI on Cloud Run↗ Playbook §2 Health and readiness probes — how to build this (Playbook §4.6 Health and telemetry)Health and readinessprobesFastAPI↗ Playbook §4.6 Untrusted-input pipeline — how to build this (Playbook §7 Security for agents)Untrusted-input pipelinePython↗ Playbook §7 Per-user rate limiter — how to build this (Playbook §4.2 Limits and budgets)Per-user rate limiterPython (in-process)↗ Playbook §4.2 Governed-agent base class — how to build this (Playbook §4 Control stack)Governed-agent baseclassPython mixins↗ Playbook §4 Autonomy policy check — how to build this (Playbook §8 Autonomy ladder)Autonomy policy checkPython↗ Playbook §8 Kill switch — how to build this (Playbook §4.5 Kill switch and dry-run)Kill switchFirestore toggle + environmentsetting↗ Playbook §4.5 Tamper-evident audit trail — how to build this (Playbook §4.3 Audit)Tamper-evident audittrailSHA-256 hash chain, Firestoretransactions↗ Playbook §4.3 Shared rate limiter — how to build this (Playbook §4.2 Limits and budgets)Shared rate limiterFirestore transactional counters↗ Playbook §4.2 PII pseudonymization — how to build this (Playbook §4.9 PII and DLP)PII pseudonymizationPython↗ Playbook §4.9 Central model registry — how to build this (Playbook §2 Reference architecture)Central model registryPython, Firestore↗ Playbook §2 Model-lifecycle steward — how to build this (Playbook §2 Reference architecture)Model-lifecycle stewardCloud Scheduler, Vertex AI Geminiwith Search grounding↗ Playbook §2 LLM usage and cost ledger — how to build this (Playbook §10 Scaling and cost)LLM usage and costledgerFirestore↗ Playbook §10 Gemini on Vertex AIGemini on Vertex AIVertex AI Async job tracker — how to build this (Playbook §4.1 Resilience)Async job trackerFirestore↗ Playbook §4.1 Async job worker — how to build this (Playbook §10 Scaling and cost)Async job workerCloud Run Jobs↗ Playbook §10 Operational datastoreOperational datastoreFirestore Structured audit log — how to build this (Playbook §4.3 Audit)Structured audit logCloud Logging↗ Playbook §4.3 One-command deploy pipeline — how to build this (Playbook §9 Delivery pipeline)One-command deploypipelineBash, Cloud Build, Artifact Registry,Cloud Run↗ Playbook §9 Smoke test and revision rollback — how to build this (Playbook §9 Delivery pipeline)Smoke test and revisionrollbackBash, Cloud Run revisions↗ Playbook §9 01 EXPERIENCE 02 EDGE 03 IDENTITY AND ACCESS 04 API AND ORCHESTRATION 05 GOVERNANCE FRAMEWORKopt-in; first adopted by the most sensitive agent 06 MODEL ACCESS 07 ASYNC EXECUTION 08 DATA AND EVIDENCE 09 DELIVERY 2 3 3 4 4 4 5 5 6 6 7 7 8 8 9 9 1
numbered arrow = flow step orange outline = opens its playbook section dashed = deploy or check path

FlowHow a request moves through it

  1. Step 1: A user opens the site on Firebase Hosting. Allowed-domain users sign in with Google. Other allowlisted users are admitted to the restricted tier, which sees only synthetic sample data.
  2. Step 2: Agent pages call relative API paths with the sign-in token attached. Hosting forwards those calls to the FastAPI service on Cloud Run.
  3. Step 3: On routes that require authentication, a shared check verifies the token, checks the allowlist (denying access if the lookup fails), and works out the data tier and admin rights.
  4. Step 4: The request reaches the agent's router. The infrastructure report analyzers send uploaded text through the sanitize, redact, injection-flag and wrap pipeline. The governed agent also runs its guard: the policy check (kill switch, autonomy rule table, decision log), then the access check, then the shared rate limit.
  5. Step 5: Registry-managed agents get their model from the central registry, and Gemini on Vertex AI does the inference. Instrumented agents write token and cost records to the usage ledger.
  6. Step 6: Short work returns directly. Long work creates a job record and returns its ID. For the longest-running agents a Cloud Run Job built from the same image does the work, and other agents use a background thread. The UI polls until the result is stored.
  7. Step 7: Results are saved in Firestore. On tier-wired agents they are tagged with tenant and data class, and read paths and totals are filtered by the caller's tier. Audit events go to Cloud Logging, and the governed agent also seals them into its tamper-evident chain.
  8. Step 8: Every week a scheduler calls a key-protected endpoint. The model-lifecycle steward test-calls each model, switches agents only off models that return not-found, applies same-tier upgrades that passed a test call, and records recommendations, blocked successors and a retirement countdown for admins.
  9. Step 9: Changes ship through one deploy command: test gate, regional build, service and worker deploy, then a health check. A separate authenticated smoke test can verify the result, and revision rollback is the escape hatch.

ControlsGuardrails built in

Verified identity for privileged access
The backend cryptographically checks Google-issued sign-in tokens (signature, expiry, audience, issuer). A typed email address alone can never reach the full data tier or admin rights.How to build this Playbook §4.8 · Secrets and identity
Deny-by-default allowlist
Admission is decided in one place (emails, domains, admins), and a failed lookup denies access. A bootstrap admin prevents lockout, the last admin cannot be removed, and every admin change and denied admin attempt is audit-logged.How to build this Playbook §4.4 · Policy
Role separation
Platform admin needs both the allowlist and a verified full-tier session. Per-agent admins can manage one agent without platform-wide rights.How to build this Playbook §4.4 · Policy
Two separate data tiers
On agents wired to the tier helpers, restricted users see only the synthetic sample tenant or records explicitly marked as containing no customer data. Untagged records are treated as customer data and hidden, and totals are filtered before they are calculated.How to build this Playbook §4.7 · Multi-tenancy
Untrusted-input defenses
On the infrastructure report analyzers and the most sensitive agent, text goes through size caps, secret redaction, heuristic prompt-injection flagging and data-not-instructions wrapping before it reaches the model. Flagged inputs are audit-logged.How to build this Playbook §7 · Security for agents
Per-user rate limits
Sliding-window limits on expensive actions, counted per server instance. The governed agent uses limits shared across instances.How to build this Playbook §4.2 · Limits and budgets
Data-residency guard on models
The model registry won't accept an admin choice served outside the approved regions unless governance explicitly turns that on. Unsupported runtimes are blocked too.How to build this Playbook §2 · Reference architecture
Model-lifecycle steward
It acts automatically only on a not-found result or a same-tier upgrade confirmed by a successful test call. Transient errors count as 'available', so a flaky check never triggers a switch. Changes to a different tier go to humans. It has a dry-run mode, an audit trail and overrides that can be reverted.How to build this Playbook §2 · Reference architecture
Kill switch (governed agent)
Stops the agent without a deploy and is checked before model calls or credential use. A kill that is already in force survives a datastore outage, and the write-capable job path refuses to run if the switch state can't be read.How to build this Playbook §4.5 · Kill switch and dry-run
Autonomy rules (governed agent)
A rule table weighing how widely the agent operates against how much autonomy it has runs on each guarded call. Fully autonomous operation is never allowed, higher autonomy in wider settings needs review, and allows and denies are recorded in an in-memory decision log.How to build this Playbook §8 · Autonomy ladder
Tamper-evident audit (governed agent)
A SHA-256 hash chain that advances transactionally across server instances. An integrity check over recent entries names any entry that was broken or altered. It runs alongside the platform's scrubbed audit log. It is not yet anchored outside the system, so it catches ordinary edits rather than a determined insider.How to build this Playbook §4.3 · Audit
Shared rate limits (governed agent)
Per-user and per-action limits on counters shared across server instances. Over the limit, the API returns a 'too many requests' response.How to build this Playbook §4.2 · Limits and budgets
Reversible PII pseudonymization (governed agent)
Customer identifiers are replaced with stable placeholder tokens before the model call and restored only for display.How to build this Playbook §4.9 · PII and DLP
Cost visibility
Instrumented agents write usage records (tokens, calls and cost), so their spend can be broken down per agent.How to build this Playbook §10 · Scaling and cost
Health and readiness
A lightweight heartbeat probe and a readiness probe that reports which backing check failed.How to build this Playbook §4.6 · Health and telemetry
Gated, reversible delivery
Deploys stop on failing containment tests. Every build is regional, a syntax check runs before the build, and a health check runs after deploy. A separate authenticated smoke test can be run, and revision rollback is available.How to build this Playbook §9 · Delivery pipeline
Human in the loop

Admins use the admin console to decide who gets in and who administers what. They choose each agent's model and can revert any change the steward made. The steward acts on its own only when a model returns not-found or a same-tier upgrade passes a test call. Any move that changes a model's tier, whether a quality drop or a cost rise, goes to a human as a recommendation, and a dry-run preview is available. Operators can switch the governed agent off without a deploy. Deploys stop on a failing test gate, and an operator triggers revision rollback.

Stack
Python 3.12FastAPI + UvicornDockerGoogle Cloud Run (service + Jobs)Firebase HostingFirebase Authentication (Google sign-in)FirestoreVertex AI (Gemini via google-genai SDK)Cloud BuildArtifact Registry (regional)Cloud SchedulerCloud LoggingReact 18 (pinned CDN builds)pytest

Change Management (OCM) Agent

Turns a formal four-phase change-management methodology into software: each deliverable is generated from a versioned methodology document and stamped with the version that produced it.

Problem

Change-management deliverables, such as stakeholder matrices, impact assessments, and communication and training plans, take a senior consultant weeks to produce, and quality depends on who writes them. Generic AI chat produces generic content, invents stakeholders and figures, and can't show which methodology it followed.

What it does

A consultant creates an engagement and picks capabilities from a configurable feature library. AI can suggest features, but only from that catalog. Uploaded source documents are extracted and summarized into structured context. The agent then writes a discovery interview tailored to the chosen features, pre-filling answers the documents already contain. The interview can be answered in the web app, or exported as a Word worksheet, taken to the customer and uploaded back. Each deliverable is then generated with the full methodology (a human-editable "skill" document) sent ahead of every prompt. That document requires a fixed output structure: which phase and deliverable this is, whether prerequisites are met, four execution tasks with any gaps listed, the model's own quality-gate checks, and practitioner notes. Finally, the agent combines everything into one change plan and exports branded PDF and editable Word documents. The methodology covers 4 phases and 18 standard deliverables. I built it on the first-generation platform.

Value

Every run works from the same methodology, so deliverable sets are consistent. Each deliverable record carries the methodology version: the declared version plus a fingerprint of the document's exact text. The model is told to flag missing information as a gap instead of inventing it, and gaps and gate results are shown for human review. Methodology owners change the practice by editing a document, with no code change, and the next deploy picks it up. A multi-week deliverable process becomes consistent, exportable output on demand.

Architecture at a glance8 layers · 16 components

Top to bottom, from the person using it down to data and delivery. Open a layer to see its components.

  1. OCM workspace

    A 3-step project wizard (details and change type, feature and custom-module selection, review), then per-project tabs for overview, documents, interview, deliverables and features, with export buttons.

    React 18 (pinned CDN), Firebase Hosting
    How to build this Playbook §2 · Reference architecture

    Practice chat

    Conversational Q&A across the practice's engagements and deliverables, with history kept separately for each signed-in user.

    Shared grounded-chat module, Gemini
  2. OCM router

    Endpoints for projects, features, documents, interview, deliverables, plan, exports, methodology status and chat, mounted on the shared backend behind the Hosting proxy.

    FastAPI
    How to build this Playbook §2 · Reference architecture
  3. Versioned skill document

    The methodology as a human-editable document. It defines a 4-phase continuous loop and 18 deliverables, each with 4 execution tasks. It also sets universal rules (classify first, respect phase boundaries, cite sources, never fabricate), phase quality gates and a mandatory structured output format.

    Markdown
    How to build this Playbook §5.1 · Tool design

    Skill loader

    Loads the methodology at startup and checks its structure (every phase section, the output format and all 18 deliverable IDs). It computes a content fingerprint alongside the declared version and serves per-deliverable lookups. If the check fails, the agent falls back to a basic prompt and stamps deliverables 'not loaded', so they can't pass as a real methodology version.

    Python, SHA-256
    How to build this Playbook §9 · Delivery pipeline

    Configurable feature library

    A catalog of change-management capabilities with starter interview questions and output guidance, stored as configuration rather than hard-coded templates. Projects can add their own custom modules.

    Firestore
  4. Document processor

    Extracts text from PDF (including tables), DOCX, PPTX, TXT, CSV and MD. A low-temperature model call then writes a structured summary: document type, key findings, stakeholders, risks, data points and relevance to the change program.

    pdfplumber/pypdf, python-docx, python-pptx, Gemini (lighter tier)
  5. Feature recommender

    Recommends 4 to 7 catalog features, each with a phase, change element and reasons. Any suggested ID that isn't in the catalog is dropped in code before the consultant sees it.

    Gemini
    How to build this Playbook §3 · Build principles

    Interview generator

    Builds 8 to 15 prioritized questions, only for the selected features, of mixed types and grouped into sections. Questions the uploaded documents already answer are pre-filled for the consultant to confirm.

    Gemini

    Interview worksheet round-trip

    Exports the questions as a Word worksheet with anchored answer blocks. The parser maps answers back by question ID, so offline and web answers are stored the same way.

    python-docx

    Deliverable generator

    Generates one deliverable per selected feature, or all of them. Every prompt starts with the methodology document and asks for the fixed structure: classification, prerequisites, execution tasks with gaps, automation pattern, content, quality-gate checks, next actions and practitioner notes.

    Gemini Pro tier
    How to build this Playbook §2 · Reference architecture

    Plan synthesizer

    Combines all deliverables and interview answers into one change plan: executive summary, approach and governance, consolidated recommendations, risk register, success metrics, timeline and next steps.

    Gemini Pro tier
  6. Centrally managed models

    Deliverables, interview, feature suggestions and the plan share one model from the platform's central registry. Document summarization uses its own lighter model. Admins can switch both, and the platform's model-lifecycle steward watches them for retirement.

    Platform model registry, Vertex AI
    How to build this Playbook §2 · Reference architecture
  7. Engagement record

    One record per project, holding selected features, custom modules, document summaries and extracted text, interview sections and answers, and deliverables. Each deliverable is stamped with the methodology version and with the phase and deliverable ID the model assigned.

    Firestore
  8. Branded PDF export

    The full engagement pack with an introduction, table of contents and interview section. Each deliverable shows phase badges, the methodology version, prerequisites, execution tasks, quality gates and practitioner notes.

    ReportLab

    Word export

    The same structured pack as an editable Word document for consultants to refine.

    python-docx
Go deeper
Architecture — layered view8 layers · 16 components
Change Management (OCM) Agent: layered architecture Layers from top to bottom: Experience, API, Methodology engine, Ingestion, Generation pipeline, Model access, State, Outputs. Numbered arrows follow the key flow listed below the diagram. Components outlined in orange link to the playbook section on how that part is built. OCM workspace — how to build this (Playbook §2 Reference architecture)OCM workspaceReact 18 (pinned CDN), FirebaseHosting↗ Playbook §2 Practice chatPractice chatShared grounded-chat module,Gemini OCM router — how to build this (Playbook §2 Reference architecture)OCM routerFastAPI↗ Playbook §2 Versioned skill document — how to build this (Playbook §5.1 Tool design)Versioned skill documentMarkdown↗ Playbook §5.1 Skill loader — how to build this (Playbook §9 Delivery pipeline)Skill loaderPython, SHA-256↗ Playbook §9 Configurable feature libraryConfigurable featurelibraryFirestore Document processorDocument processorpdfplumber/pypdf, python-docx,python-pptx, Gemini (lighter tier) Feature recommender — how to build this (Playbook §3 Build principles)Feature recommenderGemini↗ Playbook §3 Interview generatorInterview generatorGemini Interview worksheet round-tripInterview worksheetround-trippython-docx Deliverable generator — how to build this (Playbook §2 Reference architecture)Deliverable generatorGemini Pro tier↗ Playbook §2 Plan synthesizerPlan synthesizerGemini Pro tier Centrally managed models — how to build this (Playbook §2 Reference architecture)Centrally managedmodelsPlatform model registry, Vertex AI↗ Playbook §2 Engagement recordEngagement recordFirestore Branded PDF exportBranded PDF exportReportLab Word exportWord exportpython-docx 01 EXPERIENCE 02 API 03 METHODOLOGY ENGINE 04 INGESTION 05 GENERATION PIPELINE 06 MODEL ACCESS 07 STATE 08 OUTPUTS 1 2 2 3 3 4 4 5 5 6 7 8 8
numbered arrow = flow step orange outline = opens its playbook section dashed = deploy or check path

FlowHow a request moves through it

  1. Step 1: The consultant signs in through the platform and creates an engagement in a 3-step wizard: details and change type, features from the library and/or custom modules, then review.
  2. Step 2: Optionally, the AI recommends a feature set based on the description, documents and interview. Suggestions not in the catalog are discarded, and the consultant accepts or edits the rest.
  3. Step 3: The consultant uploads source documents. Text is extracted (pages and tables), summarized into structured context and stored with the engagement.
  4. Step 4: The agent generates a discovery interview scoped to the selected features, pre-filling answers the documents already contain. The consultant answers in the app, or downloads the Word worksheet, runs the customer interview offline and uploads it, and answers are mapped back by question ID.
  5. Step 5: For each feature, the deliverable generator starts the prompt with the versioned methodology document and asks for the fixed structure. The model is told to mark tasks that lack context as pending and list the gaps rather than invent content.
  6. Step 6: Each deliverable is saved with the methodology version (declared version plus content fingerprint) and the phase and standard deliverable ID from the model's classification.
  7. Step 7: The plan synthesizer combines all deliverables and interview answers into one change plan for the sponsor.
  8. Step 8: The consultant reviews gate results, listed gaps and practitioner notes, then exports the full pack as a branded PDF or editable Word document. Practice chat can answer questions across the practice's engagements.

ControlsGuardrails built in

Methodology as a versioned artifact
The methodology document's structure is checked when it loads: every phase, the output format and all 18 deliverable IDs. A fingerprint of its text becomes part of the version, so any edit to the methodology changes the version automatically. If the check fails, deliverables are stamped 'not loaded' instead of carrying a real version.How to build this Playbook §9 · Delivery pipeline
Version-stamped deliverables
Each generated deliverable record stores the methodology version, and exports print the version on every deliverable, so a deliverable can be traced to the methodology that produced it.How to build this Playbook §4.3 · Audit
Methodology rules in every prompt
Every generation call carries the full methodology and asks for a fixed structure: prerequisite status, four execution tasks, quality-gate checks (follows the methodology, sources attributed, no fabricated data) and practitioner notes. It forbids invented stakeholders, metrics or findings and tells the model to warn rather than skip phases. The model reports its own gate results, these are shown for human review, and any failed gate must be explained.How to build this Playbook §2 · Reference architecture
Closed-catalog validation
AI feature suggestions are checked against the real feature catalog in code before the consultant sees them.How to build this Playbook §3 · Build principles
Centrally managed models
The agent's models come from the platform registry, so admins can switch them and the model-lifecycle steward protects them from retirement.How to build this Playbook §2 · Reference architecture
Admin-only deletion
Deleting a project requires a verified platform admin. Both denied attempts and deletions are audit-logged.How to build this Playbook §4.4 · Policy
Authenticated, audited chat
Practice chat checks identity on the server, caps message size, keeps history separate for each user, and audit-logs requests, errors and history clears.How to build this Playbook §4.8 · Secrets and identity
Human in the loop

The consultant stays in control at every step. The AI only suggests features, and the consultant picks them. Pre-filled interview answers are flagged for the consultant to confirm or override, and the consultant runs the customer interview. Each deliverable and the unified plan are generated only when the consultant asks for them. Gate results, listed gaps and practitioner notes are there for the human change lead to review before anything is exported. Methodology owners change the practice by editing the methodology document.

Stack
PythonFastAPI router on the shared Cloud Run backendVertex AI (Gemini: Pro tier for generation, a lighter tier for document summaries)FirestoreMarkdown methodology skill (content-fingerprint versioned)pdfplumber / pypdf, python-docx, python-pptx (extraction)ReportLab (PDF export)python-docx (Word export + interview worksheet)React 18 SPA on Firebase Hosting

Infra Health Check Agent

Turns raw multi-site infrastructure health-check exports into structured, severity-labeled findings, issues tracked across runs, and reports ready to share.

Problem

Routine health checks across multi-site hyperconverged infrastructure (servers where compute and storage are combined) produce large raw JSON exports from automated check scripts, one per site, host or scan. Engineers read them by hand, so issues get skimmed or missed. A problem that keeps coming back looks new each time, and turning the output into a stakeholder report is manual work repeated every cycle.

What it does

Engineers drop one or more health-check exports into a web console. The payload first goes through an input-safety pipeline that caps size, strips stray control characters, redacts known secret and sensitive-data patterns and flags likely prompt injection. A large-context Gemini model then analyzes it in a background job. The model is told today's date, instructed to list every issue in every file section, and given a summary of the previous run for comparison. It returns structured results: overall status; findings with severity, component, site, issue, recommendation and impact; automation opportunities; alert-reliability concerns; and trend. Critical and high findings become tracked issues, merged by component across runs. Results feed a dashboard, PDF and Word reports, and a chat that answers questions across recent runs. I built it on the first-generation platform.

Value

Health findings with recommended fixes in the same structure on every run. A component's recurring problems build up an occurrence history instead of looking new each time. A coverage record shows which uploaded file sections fell within the input sent to the model, and any truncation is disclosed rather than hidden. Reports come out ready to share, with no manual write-up.

Architecture at a glance6 layers · 15 components

Top to bottom, from the person using it down to data and delivery. Open a layer to see its components.

  1. Health-check console

    Multi-file upload with in-browser compression and progress. The dashboard shows overall status, severity counts, the trend across recent runs and top open issues. The console also offers issue triage, run history, report downloads, a one-off analyzer that doesn't store results, and an agent chat tab.

    React single-page app on Firebase Hosting (pinned CDN libraries)
    How to build this Playbook §2 · Reference architecture
  2. Sign-in and access-control allowlist

    Users must be on a managed allowlist, and the lookup fails closed on errors. Full data access requires a verified sign-in token. Deleting a run is limited to admins.

    Firebase Authentication tokens verified server-side
    How to build this Playbook §4.8 · Secrets and identity

    Data-access tiers

    Restricted sessions get an empty dashboard rather than a filtered view of real infrastructure data. Run and issue lists, run detail and report downloads are tier-checked, and job status is visible only to the job's owner.

    Server-side tier checks
    How to build this Playbook §4.7 · Multi-tenancy

    Audit log

    Logs uploads, jobs, report generation, issue updates, denied access and errors as structured events, with raw-data fields scrubbed.

    JSON audit events captured by Cloud Logging
    How to build this Playbook §4.3 · Audit
  3. Secure input pipeline

    One entry point for all uploaded text. It enforces size caps, strips null bytes and control characters, and redacts known secret and sensitive-data patterns: API keys and tokens, password and secret fields, and card-number and US Social Security number formats. It also flags likely prompt injection, and anything flagged is written to the audit log.

    Python sanitizer, pattern-based redaction and injection detection
    How to build this Playbook §7 · Security for agents

    Per-user rate limits

    Sliding-window limits on uploads, chats and report downloads.

    Platform rate limiter (in-process)
    How to build this Playbook §4.2 · Limits and budgets
  4. Agent API

    Accepts compressed uploads, checks run, job and issue IDs against strict formats, restricts which fields can be updated, and returns generic error messages.

    FastAPI on Cloud Run
    How to build this Playbook §2 · Reference architecture

    Async job runner

    Returns a job ID straight away and runs the analysis in a background worker, so long analyses aren't cut off by the hosting proxy's request timeout. The browser polls the job record until the run is stored.

    Background worker + Firestore job records
    How to build this Playbook §10 · Scaling and cost
  5. Health analysis engine

    A single large-context analysis sized to the model's context window. The prompt includes today's date so historical timestamps aren't flagged as clock problems. The model is told to list every issue in every file section and compare against the previous run, and it returns structured JSON at low temperature.

    Pro-tier Gemini model on Vertex AI
    How to build this Playbook §3 · Build principles

    Coverage record

    Labels each uploaded file section as fully inside, partly inside or outside the input sent to the model. Truncation is recorded in the run and shown in reports, and the model is told to mention it in its summary.

    Section-header parser
    How to build this Playbook §6 · Evals and observability

    Malformed-output recovery

    Recovers JSON wrapped in extra text. If recovery fails, it falls back to a clearly labeled warning result instead of crashing the run.

    Python parse-and-fallback
    How to build this Playbook §4.1 · Resilience

    Agent chat

    Answers questions across recent health-check runs and is told to cite run IDs. Questions pass through the same input pipeline and are wrapped as data, and each user's chat history is kept separately.

    Gemini via the platform model registry, grounded on stored runs
  6. Run store

    Saves each run's analysis, severity counts, coverage record and a size-capped, secret-redacted excerpt of the raw input.

    Firestore
    How to build this Playbook §4.9 · PII and DLP

    Issue tracker

    Turns critical and high findings into tracked issues. A new finding on a component that already has an open issue updates that issue (occurrence count, last seen) instead of creating a duplicate. People triage issues by status, assignee and notes. Deleting a run removes only the issues seen in that run alone.

    Firestore

    Report generator

    PDF and Word reports with a coverage summary, executive summary, severity count table, severity-labeled findings, automation opportunities and alert-reliability concerns. Report generation copes with missing or malformed fields.

    ReportLab, python-docx
Go deeper
Architecture — layered view6 layers · 15 components
Infra Health Check Agent: layered architecture Layers from top to bottom: Experience, Access & governance, Input safety, Orchestration, Reasoning, Storage & outputs. Numbered arrows follow the key flow listed below the diagram. Components outlined in orange link to the playbook section on how that part is built. Health-check console — how to build this (Playbook §2 Reference architecture)Health-check consoleReact single-page app on FirebaseHosting (pinned CDN libraries)↗ Playbook §2 Sign-in and access-control allowlist — how to build this (Playbook §4.8 Secrets and identity)Sign-in andaccess-control allowlistFirebase Authentication tokensverified server-side↗ Playbook §4.8 Data-access tiers — how to build this (Playbook §4.7 Multi-tenancy)Data-access tiersServer-side tier checks↗ Playbook §4.7 Audit log — how to build this (Playbook §4.3 Audit)Audit logJSON audit events captured byCloud Logging↗ Playbook §4.3 Secure input pipeline — how to build this (Playbook §7 Security for agents)Secure input pipelinePython sanitizer, pattern-basedredaction and injection detection↗ Playbook §7 Per-user rate limits — how to build this (Playbook §4.2 Limits and budgets)Per-user rate limitsPlatform rate limiter (in-process)↗ Playbook §4.2 Agent API — how to build this (Playbook §2 Reference architecture)Agent APIFastAPI on Cloud Run↗ Playbook §2 Async job runner — how to build this (Playbook §10 Scaling and cost)Async job runnerBackground worker + Firestore jobrecords↗ Playbook §10 Coverage record — how to build this (Playbook §6 Evals and observability)Coverage recordSection-header parser↗ Playbook §6 Health analysis engine — how to build this (Playbook §3 Build principles)Health analysis enginePro-tier Gemini model on Vertex AI↗ Playbook §3 Malformed-output recovery — how to build this (Playbook §4.1 Resilience)Malformed-outputrecoveryPython parse-and-fallback↗ Playbook §4.1 Agent chatAgent chatGemini via the platform modelregistry, grounded on stored runs Issue trackerIssue trackerFirestore Run store — how to build this (Playbook §4.9 PII and DLP)Run storeFirestore↗ Playbook §4.9 Report generatorReport generatorReportLab, python-docx 01 EXPERIENCE 02 ACCESS & GOVERNANCE 03 INPUT SAFETY 04 ORCHESTRATION 05 REASONING 06 STORAGE & OUTPUTS 1 2 2 3 3 4 5 6 6 7 7 9 10 8
numbered arrow = flow step orange outline = opens its playbook section dashed = deploy or check path

FlowHow a request moves through it

  1. Step 1: An engineer drops one or more health-check JSON exports into the console. The browser joins them, adds a header for each file and compresses the payload.
  2. Step 2: The API checks the user against the allowlist, applies the per-user upload rate limit and decompresses the payload.
  3. Step 3: The input-safety pipeline caps size, strips control characters, redacts known secret and sensitive-data patterns, flags suspected prompt injection, and writes an audit event if anything is caught.
  4. Step 4: The API creates a job record and returns its ID immediately. A background worker picks up the analysis.
  5. Step 5: The worker loads a summary of the most recent run and sends the redacted input to Gemini, capped to the context budget. The request includes today's date, the instruction to list every issue, the environment notes and the required output structure.
  6. Step 6: The response is parsed (and recovered if needed), and a coverage record of which file sections fell within the model input is attached.
  7. Step 7: The run is stored with a capped, redacted excerpt of the raw input. Critical and high findings are added to the issue tracker or merged into existing issues by component.
  8. Step 8: The browser polls until the job completes. The dashboard then shows overall status, severity counts, the trend across recent runs and the top open issues.
  9. Step 9: Engineers triage issues (acknowledge, resolve, assign, add notes) and download the PDF or Word report.
  10. Step 10: The agent chat answers questions across recent runs and cites the run IDs it draws on.

ControlsGuardrails built in

Secret and sensitive-data redaction
Known API-key and token formats, password and secret fields, and card-number and US Social Security number patterns are redacted before input reaches the model and again before storage. Only a size-capped excerpt of the raw input is kept.How to build this Playbook §4.9 · PII and DLP
Prompt-injection screening
Pattern-based detection of attempts to override instructions, hijack the model's role, leak its prompt or exfiltrate data. Matches are logged to the audit trail but not blocked. In the chat and one-off analysis paths, user content is also wrapped and marked as data only.How to build this Playbook §7 · Security for agents
Input size caps
Limits apply to uploads, chat messages, environment notes and stored excerpts. Model input is capped to the context budget, and any truncation is disclosed.How to build this Playbook §4.2 · Limits and budgets
Coverage transparency
For each file, a coverage record shows whether its section was fully inside, partly inside or outside the input sent to the model. Truncation is never silent.How to build this Playbook §6 · Evals and observability
Date grounding
Today's date is added to the prompt, and the model is told not to flag historical timestamps or recommend clock fixes unless a timestamp is clearly in the future.How to build this Playbook §3 · Build principles
Structured, low-temperature output
Every finding comes back in the same JSON structure: severity, component, site, recommendation and impact. Malformed output falls back to a clearly labeled warning.How to build this Playbook §3 · Build principles
Allowlist, verified sign-in and tiers
Users must be on a managed allowlist, and full access requires a verified sign-in token. Restricted sessions see an empty dashboard and filtered lists, job status is visible only to its owner, and deleting a run is limited to admins.How to build this Playbook §4.8 · Secrets and identity
Strict request validation
Run, job and issue IDs must match strict formats, status values come from a fixed set, and only allowlisted fields can be updated.How to build this Playbook §7 · Security for agents
Per-user rate limits
Sliding-window limits on uploads, chats and report downloads.How to build this Playbook §4.2 · Limits and budgets
Audit trail with data scrubbing
Uploads, jobs, reports, issue updates, denied access and errors are logged as structured events, with raw-data fields scrubbed.How to build this Playbook §4.3 · Audit
Async execution
Analysis runs as a background job with its status tracked in Firestore, so long analyses aren't cut off by the request timeout.How to build this Playbook §10 · Scaling and cost
Human in the loop

Engineers decide what to analyze by uploading the health-check exports. They triage every tracked issue (acknowledge, resolve, assign, add notes) and own all remediation. The agent never connects to or changes infrastructure; it only reads the exports it is given. It recommends fixes and automation opportunities, and people decide what to act on. Deleting a run and its history is limited to admins.

Stack
PythonFastAPIGoogle Cloud RunFirestoreVertex AI (Gemini, Pro tier)Firebase HostingFirebase Authentication (Google sign-in)ReactBrowser-side gzip compressionReportLab (PDF)python-docx (Word)Cloud Logging