Skip to main content
Use these use cases to validate that Forge can define policy, enforce it at a real control point, and produce evidence after activity runs. Each case maps to the same Console, API, and Terraform policy contract.

Validation pattern

1

Create the policy

Open Secure -> Policies, choose New policy, then select Access policy, Content policy, or Resource Policy. Scope it to one test user, group, device, service account, agent, or AI product before using an organization-wide scope.
2

Backtest when evidence exists

Save the policy disabled or pilot-scoped, then run a backtest. A backtest proves the match logic against retained evidence. It does not prove that a live source can enforce the outcome.
3

Generate fresh activity

Enable the policy and use the same application, gateway, browser, endpoint, or agent workflow that employees use. Avoid proving an endpoint control only through a backend API call.
4

Review evidence

Open Observe -> Sessions for the activity timeline, Secure -> Violations for configured violation records, Secure -> Responses for approvals, and Secure -> Audit log for the policy revision and action history.
For HTTP, HTTPS, PostgreSQL, MySQL, and Redis connection or operation controls, follow the dedicated Resource Policies guide. Resource traffic appears under Live → Resources, not as an agent Session. For data actions, verify both the client-visible result and the Activity row: an HTTP, PostgreSQL, or MySQL target must be transformed before delivery, while Activity retains only safe paths or columns and counts. For approval, verify the first attempt is not forwarded, approve it in Responses, retry the identical operation within ten minutes, and confirm the one-use grant is consumed.

What to capture

For each test, capture the policy ID, policy revision, source surface, actor, device or service account, exact condition that matched, requested action, executed outcome, and any missing-capability diagnostic. For approval tests, also capture the request, decision, grant scope, expiration, and retry result.

Access policies

Access policies answer whether an AI product, provider, destination, process, browser, account, or local model can be used. Use Access policies for network and software control.

Block an unapproved AI API by destination

Security story: Prevent direct use of an unsanctioned AI vendor from managed endpoints, including SDK and command-line access that bypasses a corporate AI gateway. Create an Access policy: Run from a routed endpoint:
Expected result: the connection is blocked. In Forge, the activity shows the Access policy hit, the policy revision, the destination, and the executed block outcome. Policy definition:

Block a known vendor IP

Security story: Enforce a network containment decision when the security team has identified a vendor IP or test IP that should not be reachable from a managed device. Use exact IP selectors for endpoint or provider enforcement. Do not model a CIDR or IP range as a single IP policy. Create an Access policy: Run:
Expected result: TCP 443 to that exact IP is blocked. Other IPs and ports are not blocked by this policy. Policy definition:
Replace <blocked-ip> with the reachable IP you intend to test.

Require approval for a sensitive AI service

Security story: Let employees request temporary access to a high-risk AI destination while preserving a decision record and a bounded grant. Create an Access policy: Run:
Expected result: the initial attempt is held or denied until a valid grant exists. Complete the decision in Secure -> Responses, then retry the same route. The retry should be allowed only for the approved route scope and policy revision. Policy definition:

Review personal AI account use

Security story: Find employees using personal AI accounts on their Macbooks without blocking the business workflow on day one. Create an Access policy: Expected result: the activity continues, but Forge records the personal-account policy hit for review. Open the session and violation views to confirm the account evidence and actor attribution. Policy definition:

Contain disallowed local model use

Security story: Stop locally running models that are outside the approved model governance process, then create response evidence for the operations team. Create an Access policy: Expected result: compatible endpoint sources block the matching local-model route. If the source cannot prove or enforce local-model state, Forge records a missing capability or omitted-rule diagnostic instead of widening the policy. Policy definition:

Content policies

Content policies answer what may enter, leave, or happen inside an AI workflow. Use them for prompts, tool inputs, tool results, model responses, classifications, and MCP activity.

Session-based blocking examples

Use these examples to validate Content policy enforcement for a governed coding agent. Scope each policy to a pilot user, group, or agent before enabling it for a larger audience. Prompt marker test:
Tool and command tests:
Sensitive path tests:
Secret result test:
Before running the secret result test, create a harmless fixture on the test machine:
Network destination tests:
Destructive command test:
Verify the file still exists after the block:
Restricted workdir test:
Start the governed agent from /tmp/forge-restricted/session, then submit:
Multi-turn escalation test:
Bypass wording test:
Encoded command test:
Fail-closed versus fail-open validation should only run in a staging or test VM. Temporarily point the hook runtime at an unavailable Forge endpoint, then run a prompt or tool call that requires policy evaluation. Restore the endpoint before continuing other tests. Review-gated response test:
Cross-app consistency test: create the same scoped policy for Codex and Claude Code, then run equivalent prompts in each app and compare the policy decision in the session timeline. Expected result: the allowed prompt or command completes, while the blocked prompt, tool call, tool result, response, or destination records a policy hit in the session and stops at the selected checkpoint.

Redact credentials before model submission

Security story: Prevent users and agents from sending raw secrets to AI providers while retaining enough evidence to investigate repeated exposure. Create a Content policy: Test prompt:
Expected result: the original secret value is not sent forward in clear text. The session shows a redaction outcome tied to the policy revision. Policy definition:

Require approval before production commands

Security story: Put a human decision between an AI agent and production changes. Create a Content policy: Test by asking a governed coding agent to run a harmless command containing the same production marker:
Expected result: the tool call waits for approval before execution. Open Secure -> Responses to approve or deny, then confirm the session records the decision and the final tool outcome. Policy definition:

Block sensitive responses

Security story: Prevent a supported AI surface from returning regulated or confidential content to a user after the model response is available for inspection. Create a Content policy: Expected result: when the response is classified with those labels, final delivery is blocked and the session shows the response checkpoint hit. Confirm that the surface being tested supports response inspection. Policy definition:

Filter sensitive tool-result rows

Security story: Let an agent use a business tool, but remove sensitive rows from the tool result before the model sees them. Create a Content policy: Expected result: matching rows are removed from the structured tool result. If the expected array or field is unavailable and onUnavailable is block, the unfiltered result does not continue. Policy definition:

Block a high-risk MCP tool

Security story: Govern agent extensions and MCP tools with the same policy evidence used for prompts and model activity. Create a Content policy: Expected result: the selected MCP tool is blocked before execution. The session shows the MCP server, MCP tool, policy hit, and block outcome. Policy definition:

Interpreting misses

If the policy does not match, check identity resolution, group membership, device scope, selected checkpoint, field availability, and exception logic. If the policy matches but does not change the activity, check the source surface and action compatibility in Actions. For Linux endpoint tests, use Linux access support before selecting a use case. Linux route enforcement is intentionally narrower than the full Access policy field catalog.