:query endpoint. The transport is contract-only — Vertex agents carry
server-side session state via a session_id and authenticate via GCP
Application Default Credentials (ADC).
What this example tests
- All 10 ASI categories against a Vertex reasoning engine.
- GCP ADC auth via the
[gcp]extra (google-auth). - The
server_sessionpattern — AgentGuardian reuses the swarm session as Vertex’ssession_idso conversation state carries between turns.
src/agent_guardian/transports/vertex_agent.py,
src/agent_guardian/contract/schema.py
(VertexAgentTransport).
Prerequisites
- AgentGuardian with the GCP extra installed:
pip install 'agent-guardian[gcp]'. - A Vertex AI reasoning engine deployed in your GCP project. See the Vertex AI Agent Engine overview.
gcloud auth application-default loginalready run (or a service-account JSON exported viaGOOGLE_APPLICATION_CREDENTIALS).- The project id, location, and reasoning-engine id.
Run target
The target itself is your deployed Vertex agent. Export the env vars the contract dereferences:examples/gemini_agent/agentguardian.yaml):
agentguardian.yaml
VertexAgentTransport in
src/agent_guardian/contract/schema.py.
Run AgentGuardian
--model gemini:gemini-2.5-flash
(or any other AI Studio model spec) — the model that grades the swarm is
independent of the model running inside your reasoning engine.
Expected output
examples/gemini_agent/sample-scan.json ships a committed reference
shape (env-redacted) for a --model stub contract run.
Common errors
ImportError: google-auth is required for GCP ADC. Install the GCP extra:pip install 'agent-guardian[gcp]'.DefaultCredentialsError. ADC is not configured. Rungcloud auth application-default loginor setGOOGLE_APPLICATION_CREDENTIALSto a service-account JSON.PermissionDeniedon:query. The caller principal is missingaiplatform.reasoningEngines.queryon the engine. Grant theVertex AI Userrole.NotFound: reasoning engine .... Project, location, or engine id is wrong. Usegcloud ai reasoning-engines list --region <LOCATION>to confirm.
Next step
- For an AWS-deployed target, read Scan a Bedrock agent.
- For an in-process Gemini-backed demo (no Vertex deployment required),
the LangGraph fixtures under
examples/langgraph/call Gemini via the AI Studio OpenAI shim — see Scan a LangGraph agent.