Google Cloud Platform's dgem adds safety policies and preflight checks to help AI agent developers assess risks before tools run. Updated integration and deployment examples let developers connect ready-made templates to applications rather than write policies from scratch.
1. Seven executable safety policies
dgem v0.4.2 adds seven executable policy templates for security operations and responsible AI. Settings fix initial values and sample counts used for judgments. Developers can load policy templates to configure the safety checks they need.
In RAG, which uses retrieved material to generate answers, the policies distinguish following instructions in that material from merely mentioning them. A four-level rating policy addresses prompt injection that hides instructions in external material to alter model behavior.
Other templates audit changes to permissions, roles, and cloud infrastructure settings, and detect attempts to bypass safeguards. They also protect harmless contexts involving metaphors or homonyms, assess adversarial test responses in one pass, and offer configurable content moderation.
Policies also defer judgment when information is insufficient and verify credentials under C2PA, a content provenance standard. These checks go beyond harmful language to assess whether a question can be answered and whether provenance claims hold.
2. Risk assessment before Antigravity tool calls
The preflight gate for Google Antigravity acts as a checkpoint, classifying calls just before an agent runs a tool. It evaluates the inherent risk of the tool action and the origin of its instructions on separate axes.
The release provides PreToolUse integration examples for the CLI and Python SDK, a classifier with no extra dependencies, and tools that separate inputs by type. Policies use the "isolate": "all" setting and wrap instructions from external data separately as untrusted data.
The gate distinguishes actual tool use from mentions in documentation. If the value indicating judgment hesitation is below 16%, it passes the call to a second-stage Gemini evaluation, with interactive user confirmation as a safety fallback.
3. Unified Genkit integration settings and deployment flows
The Genkit Go examples unify gateway configuration through EndpointConfig, defining where requests are relayed. The same setup covers direct gateway requests and in-process integration, alongside Genkit Go v1.14.0 examples. Address, backend, and model settings, plus gateway and local execution commands, follow a consistent workflow.
Examples can run or skip multiple stages based on dependencies and question conditions, recording their status. New standalone examples for security incident classification and AI safeguards let developers start with workflows closer to their goals.
A post-hoc calibration tool adjusts probabilities through temperature scaling, aligning them with actual accuracy, and checks whether calibrated hesitation exceeds a threshold. Along with conditional execution, it helps pass policy judgments to subsequent stages.
Installation offers two options: download a prebuilt archive or use Go tooling. The instructions recommend verifying archives against SHA256SUMS. The Go installation command is:
go install github.com/GoogleCloudPlatform/dgem@v0.4.2Deployment scripts support environment configuration wiring for service accounts and virtual private networks. They also automatically enable Private Google Access for virtual private network egress. Image builds create both a commit identifier tag marking revision history and a tag pointing to the latest image.
The server container image for Cloud Run deployment remains unchanged from v0.4.0. This release focuses on the gateway, policy templates, agent integrations, and tooling.
4. Policy application and integration in one release
Policy templates and the pre-call gate provide building blocks for safety checks in application integration and deployment workflows. Shared integration settings can reduce the need to configure gateways separately for each example. Teams using conditional stages and confidence-based reevaluation or user prompts must still adapt each policy and interaction flow to their environment.
dgem v0.4.2 delivers safety policies as executable templates and connects them to Antigravity and Genkit integration workflows.
