Author a policy
- Open Policies, choose New policy, then select Resource.
- Scope it to Resources and, when needed, users, groups, service accounts, devices, or proven processes.
- Build conditions from the fields supported by the selected protocols.
- Choose an action and add a useful customer message for a block or approval.
- Use Monitor to observe matches or Enforce to apply the action.
- Add a narrow exception if needed, run a backtest, then save and enable it.
Resource fields
Evaluation timing is inferred from the fields. Connection fields run before a
connection opens. HTTP fields run for each request. Database and Redis fields
run before each command. There is no separate evaluation-stage setting.
Product
For automatically routed traffic, the device walks a bounded process ancestry and matches each process against Forge’s product catalog.product.id contains
every unambiguous recognized product in that chain. If Claude Code starts from
Codex, for example, a policy selecting either product matches. Forge discards
ambiguous matches rather than choosing one arbitrarily.
Direct Resource gateway clients do not provide trusted endpoint process
context, so product.id is unavailable. A policy that requires an originating
product does not match that traffic; policies scoped by Resource, identity,
protocol, or operation continue to evaluate normally.
HTTP bodies and database result values may be transient transformation inputs,
but they are not condition fields or retained activity. Query parameters,
authorization values, cookies, raw SQL, comments, bind values, Redis arguments,
and credentials are also excluded.
Actions
Redaction and filtering require exactly one supported data target. Forge
rejects a target or action that all selected Resources cannot execute. See the
individual protocol guides for transformation
limits and fail-closed behavior.
Allow records a match without overriding a stronger result. Flag for
review permits the operation and highlights it. Block stops the operation
before it reaches the destination. Action precedence follows the shared
Actions contract.