Choose a policy type
Create a Content policy for prompts, model responses, tool inputs, tool results, classifications, or MCP activity. Create an Access policy to govern whether a user, group, device, process, account, provider, or AI product can be used. Create a Resource policy to govern connections, HTTP requests, or PostgreSQL commands for configured Resources.Define the scope
Select the identities and assets the policy should cover. Content offers service accounts, agents, products, MCP servers, and tools; Access offers users, groups, and devices alongside AI route conditions; Resource offers users, groups, service accounts, devices, and Resources. A directory group expands to its resolved members during evaluation; verify directory sync before relying on a new group. Keep the first scope narrow enough to test with a known identity and real activity. Scope determines where the policy applies; conditions determine whether an in-scope event matches.Build match conditions
Use All when every condition must match and Any when one matching branch is sufficient. Conditions can use identity and product context as well as observed prompt, tool, response, model, destination, process, and classification fields. For sensitive-data controls, select the data labels Forge should match and the checkpoint where the data is available. For behavior that develops over time, use a prior-session condition such as a prior matching event, a sequence of events, or a count within a time window. Add an exception only when a narrower case should suppress an otherwise valid match. Exceptions do not create an allow that overrides another policy. Select Edit policy as code when a reviewed native condition tree or bounded Rego rule is easier to maintain in code. The visual editor and policy-as-code view describe the same saved policy rather than separate enforcement paths.Select an outcome
Available outcomes depend on the policy type and evaluation checkpoint:- Allow records the match without overriding a stronger policy.
- Nudge adds guidance when the enforcing surface can deliver it.
- Flag for review allows the activity and records it for review.
- Redact replaces sensitive content before it continues.
- Filter removes matching items from a supported tool result.
- Require approval holds supported activity until an allowed approval scope is granted.
- Block prevents the operation at an enforcement-capable control point.
Test before broad enforcement
- Save the policy disabled or scope it to a pilot identity.
- Run a backtest against compatible historical evidence.
- Review matches, unavailable fields, and exceptions.
- Enable the policy for the pilot.
- Wait for enforcement activation. If the editor shows Saved — activating…, refresh after a moment and do not run the acceptance test until the activation notice is gone.
- Generate fresh activity through the intended gateway, endpoint, or integration.
202 Accepted and the
X-Forge-Gateway-Authority-Propagation: propagation_pending response header
when the definition is stored but gateway enforcement is still updating. In
that case, wait before sending the live canary. Repeat the same narrow canary
until it returns the intended policy outcome, and retain the policy revision
and request ID with the test result.