Implementation Guide

    Stopping applications from setting Vertex AI Gemini safety settings to BLOCK_NONE

    Gemini safety settings travel with each request, so the calling application chooses the thresholds. To enforce a minimum, you need a control that reads the request itself. Code review, CI checks and shared libraries reduce risk but can be skipped. A runtime policy layer in the request path can reject or rewrite non-compliant thresholds on every call and record evidence that it did.

    Designing the enforcement approach

    1. 1

      Define the minimum

      Set the least restrictive threshold allowed for each harm category, ordered from least to most restrictive, and name who can approve an exception.

    2. 2

      Decide reject or rewrite

      Rejecting makes the violation visible to the developer. Rewriting to the minimum keeps the application working but can hide a misconfiguration, so pair it with notification.

    3. 3

      Handle missing settings

      Treat an absent safety setting as non-compliant and apply the required value explicitly rather than relying on model defaults.

    4. 4

      Constrain the route

      Use access controls so applications reach Gemini only through the enforcement point.

    5. 5

      Add early feedback

      Run CI checks and a shared library so developers learn about violations before runtime.

    6. 6

      Record every decision

      Capture each allow, rewrite and block as evidence, not just the failures.

    How safety settings reach a Gemini request

    In Vertex AI, safety settings are part of the request that an application sends to a Gemini model. Each setting pairs a harm category with a threshold, and the threshold determines how aggressively content in that category is blocked. BLOCK_NONE is the value that turns blocking off for the category it is paired with.

    Because the values are supplied by the caller, the decision sits with whichever team writes the application. A developer tuning a prototype to avoid false positives can set BLOCK_NONE, and that value can then move into production unchanged. Nothing in the request path asks whether anyone approved it unless you add a control that does.

    Two details matter for policy design. First, a missing setting is not the same as a compliant setting. Defaults can differ across model versions, so a rule that only looks for the literal string BLOCK_NONE will miss requests that omit the field and inherit a more permissive default than you intended. Second, safety thresholds are one layer. The NIST Generative AI Profile notes that restricting model outputs may still allow harmful recommendations in response to less explicit or novel prompts. Treat the threshold as a floor within a broader defense, not a complete control.

    What access controls can and cannot do

    IAM roles, project boundaries and network perimeters answer a specific question: who or what may call the service, and from where. They are the right tools for applying least privilege to service accounts, a practice organizations commonly draw on when securing AI systems.

    A control can enforce the value of a request field only if it inspects the request body. When you evaluate a native mechanism, ask whether it evaluates the contents of the call or only the identity and location of the caller. If it evaluates only the caller, an authorized service account can still send any threshold it likes. Confirm this against current Google Cloud documentation for each mechanism you plan to rely on, including organization policy constraints, rather than assuming coverage.

    That gap is why the enforcement decision usually becomes a question of where in the delivery chain you inspect the parameter, and how much of that chain an application team can route around.

    Comparing enforcement points

    The four common enforcement points differ mainly in coverage and in how easily they can be bypassed. The table summarizes the tradeoffs as general design properties.

    • Code review and CI checks: Coverage: repositories that run the check. Bypass risk: high, since checks can be skipped, misconfigured or absent, and values built at runtime may not appear in code. Overhead: low.
    • Shared client library or wrapper SDK: Coverage: applications that adopt it. Bypass risk: moderate to high, since a team can call the API directly. Overhead: moderate, because the library needs versioning and upgrades across teams.
    • Google Cloud access controls: Coverage: every caller of the project or perimeter. Bypass risk: low for who can call, but they may not constrain parameter values. Overhead: low to moderate.
    • Runtime policy layer in the request path: Coverage: every request that passes through it. Bypass risk: low if direct calls to the API are prevented by access controls. Overhead: moderate, because it is a component you operate and size.

    Why review-time checks are not enough alone

    CI checks and library defaults are worth having. They give developers fast feedback and catch most accidental cases before deployment. Their weakness is that they act on code, not on traffic. A pipeline can be bypassed by an emergency change, a forked repository or a service that was never onboarded. Settings assembled from configuration or user input at runtime may never appear as a literal in source.

    Runtime enforcement closes that gap because it evaluates what is actually sent. Its coverage depends on one condition: requests must have no alternative route. In practice that means pairing the policy layer with access controls so that application service accounts can reach Gemini only through the layer. Without that pairing, the layer is another optional component.

    Evidence that enforcement occurred

    Showing that a threshold was enforced requires more than a policy document. Auditors and security teams need to see, over time, that requests were evaluated and what happened to them. The fields below are a design recommendation: the requesting application and service account, the model and timestamp, the safety settings as submitted, the settings as sent, the policy version applied, and the action taken (allowed, rewritten or blocked).

    Record compliant requests as well as violations. A record containing only blocks cannot show that everything else was checked. Store the evidence outside the application's control, apply a retention period that matches your audit obligations, and make the policy version part of each record so you can show which rule was in force on a given date.

    This evidence also supports mapping to frameworks such as the NIST AI Risk Management Framework and its Generative AI Profile, where you need to show a risk control operating in practice. Check the specific controls you map to before making claims.

    Where Trussed fits

    Trussed enforces policy in the execution path across models, agents, tools and coding assistants, with actions that include allow, redact and block on individual interactions. Enforcement generates audit-ready evidence, and the platform can be deployed self-managed in the customer cloud with configurable retention and data residency. For a regulated enterprise, that combination addresses the runtime enforcement and evidence steps described above. It is one option among the approaches in this guide, and the CI, library and access-control layers remain useful alongside it.

    Where a safety threshold can be enforced

    Review and CI

    Catches BLOCK_NONE in code before merge. Can be skipped.

    Shared client library

    Applies a default threshold. Applies only if teams use it.

    Access controls

    Decide who can call the API, not necessarily what the request contains.

    Runtime policy layer

    Evaluates each request and records the decision as evidence.

    Enforce a minimum safety threshold on every request

    Talk to an expert about enforcing policy in the request path and producing audit-ready evidence of each decision.

    Talk to an Expert