Without a shared execution layer, every team that builds an agent rebuilds hosting, identity, tool access, memory, approvals, cost controls and evaluation, each slightly differently. An agentic harness is one layer every agent runs on, so teams write domain logic and inherit the rest. On Gemini Enterprise Agent Platform it is assembled mostly from managed parts: ADK for agent structure, Agent Runtime, Sessions and Memory Bank for execution, Agent Identity per agent, Agent Gateway as the policy point on every tool call, Agent Registry as the approved catalog, and Model Armor for screening. Finished agents are published into the Gemini Enterprise app. Below: the layers, four execution models, one tool call traced through the Gateway, five use cases, the CI/CD gates, a 90-day rollout and a checklist.
Gemini Enterprise on Google Cloud · a five-part series
1. Reference architecture ·
2. Enterprise knowledge bases ·
3. The agentic harness ·
4. Real-time context ·
5. Agentic L1 resolution
Why every agent needs the same harness
The first agent in a company is usually a small project: a prompt, a few tool functions, and a service account that can reach whatever the tools need. Then ten more teams start agents, and each has to answer the same questions again:
- Where does the agent run, and where does conversation state live?
- Which identity calls Jira, GitHub or BigQuery: the agent’s, the user’s, or both?
- What may it do alone, and how does a person approve the rest?
- What may it remember across sessions, and how is it protected from prompt injection in the content it reads?
- How much may it spend, how do we know a new version is better, and can we see every step it took?
When each team answers these on its own, one agent has an approval step and another does not, one logs tool calls and another does not, and security reviews start from scratch every time. After a few quarters the company has many agents and cannot say what any of them is allowed to do.
The agentic harness is the reusable execution layer every agent in the company runs on. Hosting, sessions, memory, identity, tool access, policy, approvals, safety screening, cost limits, evaluation and observability become shared services with one set of rules. A team writes instructions, domain tools and a workflow, and inherits everything else. Security reviews the harness once, and after that each agent review covers only its tools, authority limits and evaluation results.
The test for a good harness: a team can take a new agent from idea to a governed pilot in a couple of weeks, and the only code it writes is code a domain expert would recognise as theirs.
Since Google’s April 2026 relaunch of Gemini Enterprise, the Agent Platform (the evolution of Vertex AI) ships most harness layers as managed services. The enterprise still has to put them together, set the policies and build the company-specific pieces. Part 1 covered the whole platform; this post covers the layer that runs agents.
The harness, layer by layer
The harness has five layers plus an optimisation practice across all of them. Only one layer belongs to the team building the agent.
Entry points. An employee in the Gemini Enterprise app, an internal application calling an API, a schedule or an event. Each gives the agent a task, a caller identity and a session.
Agent logic. What the team writes in ADK: instructions, tools, sub-agents, the workflow graph, and a declarative authority configuration stating what the agent may do alone, what needs approval and what it may never do. The agent declares that configuration and the harness enforces it.
Runtime. Agent Runtime (formerly Vertex AI Agent Engine) hosts and scales the agent. Agent Platform Sessions keeps conversation state, Memory Bank keeps selected facts across sessions, and the Code Execution sandbox runs model-written code away from production systems.
Control plane. Agent Identity gives each agent its own cryptographic identity for access control and audit. Agent Gateway enforces policy on tool calls and on agent-to-agent and MCP traffic. Agent Registry is the catalog of approved agents, tools and MCP servers. Model Armor screens for prompt injection, tool poisoning and sensitive-data leakage.
Tools and other agents. Tools are MCP servers wherever possible, one per system, owned by the system’s team. Other agents, including those hosted outside Google Cloud, are reached over A2A. Every call goes through the Gateway.
Agent structure with ADK
The Agent Development Kit is Google’s open, model-agnostic, graph-based framework for agents. Four concepts cover most designs:
- Instructions. The role, rules and required output. Keep them in version control and review them like code.
- Tools. Functions and MCP toolsets the model may call. In the harness, an agent asks for tools by Registry name and receives them already wired through the Gateway with its identity.
- Sub-agents. Narrower specialists (a test writer, a summariser, a policy checker) with fewer tools, which makes each easier to evaluate and safer to run.
- Workflows. When the steps are known in advance, express them as a graph of sequential, parallel or looping steps. Use the model for judgement and the graph for the order of work.
Here is the shape of a pull-request review agent built on the harness. This is an illustrative sketch, not copy-paste code: the agent classes follow ADK’s Python style, while harness.* stands for the thin internal library a platform team puts around ADK. Check the current ADK documentation for exact signatures.
# SKETCH ONLY: ADK-style structure; harness.* is your platform's own wrapper from google.adk.agents import LlmAgent, SequentialAgent import harness # internal: Registry lookup, Gateway-wired tools, routing, limits reviewer = LlmAgent( name="pr_reviewer", model=harness.route("code-review"), # model routing by task class instruction=harness.prompt("pr_reviewer/v7"), # versioned in git tools=harness.tools("github-mcp:read", "repo-standards:search"), ) test_writer = LlmAgent( name="test_writer", model=harness.route("code-gen"), instruction=harness.prompt("test_writer/v3"), tools=harness.tools("github-mcp:read", "sandbox:run_tests"), ) pr_review = SequentialAgent( # fixed order: review, then tests name="pr_review_workflow", sub_agents=[reviewer, test_writer], ) # Declared, not enforced here: the Gateway and approval service enforce it AUTHORITY = harness.authority( allow=["github-mcp:comment"], approve=["github-mcp:push_branch"], # human approves in Inbox deny=["github-mcp:merge", "github-mcp:admin"], budget=harness.budget(tokens_per_run=200_000), )
What the sketch leaves out matters most: there are no credentials, HTTP clients, retries, logging, safety filters or session storage in it. The team wrote two prompts, picked tools from the catalog and declared its authority. The harness supplies the rest.
Four execution models, one harness
Agents are often thought of as chatbots, but much of the enterprise value comes from agents nobody chats with. The harness supports four execution models on one stack.
Interactive chat. The employee opens the agent from the Agent Gallery or inside a Project. The app passes the user identity, Sessions holds the conversation and the agent streams its answer. If a request will take minutes, the agent hands it to the background model and says so.
Scheduled. Nightly reconciliation, weekly release notes, hourly data-quality sweeps. Cloud Scheduler calls a small invoker on Cloud Run, which calls the agent on Agent Runtime with a run ID derived from the schedule window, so a retried trigger finds the existing run and exits. No user is present, so the agent runs under its own Agent Identity with permissions scoped to the job.
Event-triggered. A pull request opens, a file lands in Cloud Storage, an alert fires or a record changes (see Part 4). Pub/Sub or Eventarc delivers the event to the invoker, which deduplicates on the event ID, because delivery is at least once, and maps the event to a task.
Long-running background work. Reconciling a month of transactions or processing a document backlog should not run as one model loop that dies on the first timeout. The harness splits the work into steps, checkpoints after each one, and runs the sequence with Workflows or a Cloud Run job so that a failure resumes from the last checkpoint. Approvals the result needs go to a named approver in the Gemini Enterprise Inbox or the ITSM.
Components mapped to Google Cloud
The third column is where most of the platform team’s effort goes.
| Harness responsibility | Google Cloud service | What you still decide or build |
|---|---|---|
| Agent structure | Agent Development Kit (ADK); Agent Studio for low-code; Agent Garden templates | A thin internal wrapper (tool lookup, routing, authority config) and repo templates |
| Hosting and scaling | Agent Runtime | One project per environment, region, CMEK, VPC Service Controls perimeter |
| Conversation state | Agent Platform Sessions | Session retention period; what gets redacted before storage |
| Long-term memory | Agent Platform Memory Bank (memory profiles) | A written memory policy: what is remembered, what never is, and how users delete it |
| Code the model writes | Code Execution sandbox | Which agents may use it; no network path to production |
| Agent identity | Agent Identity, Cloud IAM | Least-privilege roles per agent; no shared service accounts |
| Acting for a user | OAuth authorization resources in Gemini Enterprise | Which scopes each agent may request; consent wording |
| Policy on every call | Agent Gateway (with IAP and access policies) | Per-agent tool allow-lists, authority limits, rate limits |
| Approved catalog | Agent Registry | The review process that adds an agent, tool or MCP server |
| Content safety | Model Armor | Templates per risk tier; block versus flag behaviour |
| Triggers | Cloud Scheduler, Pub/Sub, Eventarc, Workflows, Cloud Run | A shared invoker with idempotency and dead-lettering |
| Evaluation | Agent evaluation (multi-turn autoraters, online evaluation), Agent Simulation | Golden datasets per agent, pass thresholds, CI/CD wiring |
| Observability | Agent Platform logging and tracing, Unified Trace Viewer, Cloud Logging, Cloud Monitoring | Dashboards per agent, alert routing, retention, cost attribution labels |
| Secrets | Secret Manager | Rotation; keep secrets out of prompts, tools and traces |
| Distribution to employees | Gemini Enterprise app (register ADK on Agent Runtime, or A2A) | Which groups can use each agent; descriptions that set expectations |
Sessions and Memory Bank: what to remember, and what never to
Sessions holds one conversation or run. Memory Bank persists across sessions: a preferred report format, the repository a developer usually works in, the entities an analyst reconciles. Without a policy it becomes an unreviewed store of personal data. Write the policy before enabling it:
Write the memory policy before you enable Memory Bank. In practice we use three rules:
- Remember preferences, defaults, teams and recurring tasks.
- Never remember credentials, customer or employee personal data beyond the agent’s function, health, payroll or performance information, content other users of a shared agent cannot see, or anything the user asked it to forget.
- Re-fetch facts that change, such as balances, ticket status and approval limits. A stale remembered fact is worse than none.
Memory writes pass through Model Armor, and users can see and delete what an agent remembers about them.
One tool call through Agent Gateway
If agents call tools directly, every rule in the authority config is only advisory. If every tool and agent-to-agent call passes through Agent Gateway, the rules are enforced in one place and recorded in one trace. Here an engineering agent opens a Jira ticket for a user.
- Two identities on one call. The agent identity bounds what this agent can ever do. The user’s OAuth authorization limits the call to what that user may do. The effective permission is the intersection.
- Results are screened too. A ticket body or invoice can carry text written to steer the agent. Indirect prompt injection arrives through tool results, so Model Armor screens what comes back.
- Approval is a state, not an error. An over-limit action becomes an approval request with the exact action and the agent’s reason, shown to a named approver in the Gemini Enterprise Inbox or your ITSM; the run resumes or stops on the decision.
Five use cases on one harness
In each case the domain team writes a small amount of code and the harness provides the rest.
1. Engineering automation: PR review, test generation, release notes
When a pull request opens, a reviewer sub-agent reads the diff through the GitHub MCP server, checks it against team standards from the knowledge base (Part 2) and comments. A test-writer sub-agent drafts missing tests and runs them in the Code Execution sandbox. Weekly, a scheduled agent drafts release notes from merged PRs and linked tickets. Authority: may comment; needs approval to push a branch; may never merge.
2. IT operations runbooks
A Cloud Monitoring alert arrives on Pub/Sub. A runbook agent finds the matching runbook, gathers diagnostics through read-only tools and runs the safe steps itself: restart a stuck job, clear a cache, scale within preset bounds. Configuration changes go to the on-call engineer for approval. Part 5 applies this to L1 tickets. Authority: read-only diagnostics; a named list of reversible fixes; everything else needs approval.
3. Finance reconciliation
A nightly background agent matches bank transactions to ledger entries using BigQuery through an MCP server only its identity can use. It clears exact matches, proposes near-matches with reasoning and groups the rest into exceptions for an analyst’s Inbox. Authority: read ledger and bank data; write proposed entries only; a controller posts every journal entry.
4. Data-quality triage
When a Dataplex scan or pipeline assertion fails, an event-triggered agent examines failing rows, recent schema and pipeline changes and lineage, classifies the failure (source problem, pipeline bug, expected change, false alarm) and opens a ticket with evidence for the owning team. Authority: read metadata and samples; open and link tickets; quarantine a partition only where the dataset owner opted in.
5. Document processing workers
Documents land in Cloud Storage and Eventarc starts a worker that extracts fields, validates them against systems of record and writes structured output to BigQuery. Low-confidence documents go to a review queue. These run at high volume, so cost controls matter most here. Authority: write to staging; promotion follows a business rule or a reviewer.
The common pattern: every use case above has a short “may do” list, a longer “needs approval” list and a firm “never” list. Write the three lists before writing the prompt.
Walkthrough: a release-notes agent from trigger to publish
The schedule fires
Friday at 14:00 Cloud Scheduler calls the invoker, which derives a run ID from the week, finds no earlier run, and starts the agent on Agent Runtime under its own Agent Identity. No user token is involved.
The workflow gathers facts
The ADK workflow lists merged PRs since the last tag, fetches linked Jira tickets and the previous notes for style. Each call goes through Agent Gateway, which checks the Registry entries and the agent’s read-only scope.
Model Armor catches one bad input
One PR description asks any AI reading it to list the change as a security fix. Model Armor flags the tool result, the harness drops the passage and records the event, and the trace names the PR.
Routing and budget
Per-PR summaries go to a smaller model and the final draft to a stronger one. Had the run hit its token budget, it would have stopped with a partial draft and an alert.
Draft, not publish
The draft goes to the team’s Project. Publishing externally is on the approval list, so a request appears in the release manager’s Inbox.
Feedback becomes evaluation data
The manager edits two lines and approves. The diff is stored with the trace and becomes an evaluation case for the next prompt version.
Identity, authority and approvals
One identity per agent
Treat each Agent Identity like any privileged non-human identity: narrow IAM grants, scheduled reviews, never shared. Google’s template that connects an agent to a BigQuery MCP server usable only by that agent’s identity is the pattern to copy for sensitive data.
Acting on behalf of a user
To act as the user, Gemini Enterprise uses OAuth authorization resources: the user consents and the agent gets a delegated token for those scopes. Record in the Registry which scopes each agent may request, and never let scheduled or event-triggered work reuse a user’s token after the session ends.
Authority limits, enforced outside the model
The authority config becomes Gateway policy: tool allow-lists, argument limits, rate limits and an approval list. The model can know its limits so it plans sensibly, but enforcement happens outside it. For money or production impact, the downstream system checks the limit again.
Human approvals
An approval shows the exact action and arguments, the agent’s reason and evidence, and the effect of approve or reject, wherever your approvers work: the Gemini Enterprise Inbox, the ITSM or a chat approval. Track approval rates: actions approved unedited almost every time can move to the “may do” list; frequent rejections point to a misunderstanding.
Registry as the front door
Nothing runs or is called unless it is in Agent Registry. New MCP servers, partner A2A agents and new agent versions enter through a review recording owner, data classification, scopes, Model Armor template and evaluation results. That review is security’s main control point.
Perimeter and data protection
Run Agent Runtime, MCP servers and their data inside a VPC Service Controls perimeter, use CMEK where required, keep secrets in Secret Manager and send findings to Security Command Center.
Cost controls
A loop that retries a failing tool fifty times can spend a month’s budget in an afternoon. The harness controls spend in four places:
- Token budgets per run. At the ceiling the agent stops with partial results and an explanation. Set ceilings from observed runs.
- Quotas per agent and team, attributed through labels on every trace.
- Model routing. Classification and extraction go to smaller models, planning and hard reasoning to stronger ones. ADK is model-agnostic, so routing is harness configuration.
- Loop guards: a cap on tool calls per run, detection of repeated identical calls, and caching of stable results.
Report cost per successful outcome (per reconciled account, per reviewed PR), which finance can compare with the cost of the work.
Evaluation, simulation and CI/CD
A prompt edit, a tool description, a model version or a new sub-agent can each change behaviour, so the harness treats all of them as releases.
Offline evaluation
Every agent has a golden set of real tasks with expected outcomes, including past failures. Agent evaluation supports multi-turn autoraters, so whole runs are scored: task success, tool choice and arguments, policy compliance, groundedness, cost. Releases must meet thresholds, and any case that used to pass and now fails blocks the release.
Agent Simulation
Agent Simulation generates synthetic multi-turn users for what has not happened yet: users who change their request, users who push the agent past its authority, tools that error or return poisoned content. Run it for every release and grow the adversarial suite after every red-team finding.
Shadow, canary and online evaluation
Agents that act run in shadow on real triggers (actions recorded, not executed), then as a canary. In production, online evaluation scores sampled live runs so drift shows on a dashboard.
Observability
Each run is one trace: trigger, model calls with tokens, tool calls with the Gateway decision, Model Armor verdicts, approvals and outcome, viewed in the Unified Trace Viewer, with metrics and alerts in Cloud Logging and Cloud Monitoring. Start with four dashboards per agent: success rate, latency, cost per outcome and policy events.
Publishing into the Gemini Enterprise app
An ADK agent on Agent Runtime is registered into the Gemini Enterprise app from the console (Agents, then Add agent) or the REST API; agents hosted elsewhere register as A2A agents. Admins choose which users can use each one. Automate this step so employees only ever see what passed the gates.
A 30/60/90-day rollout
Start from one real agent, not a platform with no users.
Days 1–30: the minimum harness and one agent
Environments, perimeter and CMEK. Agent Runtime, Sessions, Agent Identity, Agent Gateway and a small Registry. The internal ADK wrapper and repo template. One narrow, read-mostly agent (PR review or data-quality triage) with a golden set, published to a pilot group.
Days 31–60: actions, approvals and the pipeline
Authority configs, Inbox approvals and Model Armor templates by risk tier. The shared invoker for scheduled and event runs. Evaluation and Agent Simulation as blocking CI/CD gates. A second agent in another function to prove reuse. The memory policy, then Memory Bank where needed.
Days 61–90: scale and self-service
A published Registry review process, token budgets, team quotas, model routing, cost per outcome and online evaluation. Two or three teams building their own agents on the template while the platform team only reviews.
VerticalServe has spent seven years building data and AI platforms on Google Cloud, including enterprise GenAI and Vertex AI platforms for a global retailer and a large utility, and runs production agentic systems in insurance. InsightWorker, our multi-agent harness, follows the same principles and can shorten the first 30 days where it fits.
Failure modes to plan for
1. Tools called around the Gateway. A direct API call added “just for now” escapes policy, audit and screening. Block egress from Agent Runtime except to the Gateway and approved endpoints.
2. One powerful service account for every agent. Use one Agent Identity per agent from day one, even in the pilot.
3. User tokens kept after the user has left. Background and scheduled work run as the agent, never on a retained user token.
4. Authority limits that exist only in the prompt. A limit written in the prompt is a suggestion; the same limit in Gateway policy is a control.
5. Memory nobody governs. Without a written policy, Memory Bank collects personal data and stale facts. Policy first, screened writes, user deletion.
6. Evaluation that is not a gate. Evaluation shown only on a dashboard after release lets regressions reach users. Make it a blocking CI/CD step.
7. Approval fatigue. When everything needs approval, approvers stop reading. Review approval rates monthly and move routine, reversible actions to “may do”.
Readiness checklist
| Area | Ready when |
|---|---|
| Agent template | A repo template and internal ADK wrapper exist; a new agent needs only instructions, tools by name and an authority config |
| Runtime | Agent Runtime, Sessions and Code Execution run in per-environment projects inside a VPC Service Controls perimeter |
| Identity | Every agent has its own Agent Identity with least-privilege roles; no shared service accounts |
| Delegation | OAuth authorization scopes per agent are recorded in the Registry; background work never reuses user tokens |
| Gateway | All tool, MCP and A2A traffic passes through Agent Gateway; direct egress is blocked |
| Registry | Agents, tools and MCP servers are added through a documented review with an owner and data classification |
| Authority | Each agent has may-do, needs-approval and never lists enforced as policy, with approvals in the Inbox |
| Safety | Model Armor screens prompts, tool arguments, tool results and memory writes |
| Memory | A written memory policy exists; users can see and delete their memories |
| Triggers | A shared invoker handles schedules and events with idempotency and dead-lettering |
| Cost | Token budgets per run, quotas per team, model routing and cost per outcome are in place |
| Evaluation | Golden sets, Agent Simulation and thresholds block promotion in CI/CD; online evaluation runs in production |
| Observability | Every run is one trace with policy decisions; dashboards and alerts exist per agent |
| Distribution | Registration into the Gemini Enterprise app is automated, with access set per group |
The bottom line
Agents multiply faster than the people who can review them. That only works if what makes an agent safe and dependable is built once, owned by a platform team and inherited by every agent. Gemini Enterprise Agent Platform now provides most of those parts as managed services; the enterprise’s job is to connect them, write the policies and make the harness the easiest path.
Then a team that wants a reconciliation or runbook agent writes the domain logic and three authority lists, passes the gates and publishes to the Gemini Enterprise app, and security reviews only what is new.