Author your first policy
By default, Wicket allows every tool call that passes authentication. Policies let you restrict what tools agents can call — by service, tool name, time window, or specific repos and channels.
This tutorial creates a forbid policy that blocks GitHub destructive tools (file deletion and PR merges) while leaving read and write tools unrestricted.
Prerequisites
- A Wicket agent with GitHub connected — see the Quickstart if you need one
-
Open the Policies tab
In the Wicket dashboard, open your agent and click Policies. Click New policy.
-
Name and configure the policy
Fill in the form:
Field Value Name Block GitHub destructive toolsService GitHubEffect ForbidPrincipal All members -
Select tools to restrict
Under Tools, find and check the destructive tier:
delete_filemerge_pull_requestcreate_repository(optional — also block repo creation)
-
Preview the Cedar policy
Click Preview to see the raw Cedar policy Wicket will compile. It should look like:
forbid (principal,action in [GitHubMCP::Action::"delete_file", GitHubMCP::Action::"merge_pull_request"],resource);This is informational — you don’t need to edit Cedar directly.
-
Save and enable
Click Save. The policy is created in the enabled state. From this point, any call to
delete_fileormerge_pull_requestreturns a deny decision — no restart required. -
Test the policy
In Claude Desktop or Claude Code, ask:
Delete the README file from one of my repositories.
Wicket denies the request. Open the Audit tab to confirm — the row shows
DENYand the matched policy name.
Add a time constraint (optional)
Policies can include time windows. The natural goal — “allow destructive tools only during business hours” — has to respect Cedar precedence: a matching forbid always wins over a matching permit. So you cannot get the effect by leaving the blanket forbid above in place and adding a windowed permit; the forbid would still match and the call would be denied.
Instead, put the time constraint on the forbid, so the block only applies outside business hours. Replace (or disable) the blanket forbid from the steps above with a forbid policy that carries the time window:
- Effect:
Forbid - Tools: destructive tier
- Time constraints: the hours you want to block (e.g. evenings/weekends)
Then add a broad permit for the same tools (or rely on a separate permit that already covers them). Now:
- Inside the allowed window → the forbid’s time condition doesn’t match, so a
permitcan take effect → ALLOW - Outside the window → the forbid matches → DENY
Next steps
- Policy recipes — common patterns for GitHub, Slack, and Linear
- Structured policy schema — full field reference
- Move to production — harden policies before team rollout