Surfil

Simulate a rule before it ever enforces

surfil policy simulate replays a rule over the events already on your machine and tells you exactly what it would have caught. Nothing is blocked by simulating, so you decide with evidence from your own traffic rather than a guess.

Replay a rule over what you already recorded

A rule is one or more --match conditions over the metadata your spine records. It runs against the events already on disk - no traffic is generated, nothing leaves the machine, and no request is affected.

$ surfil policy simulate --match guard=blocked
surfil policy - simulate `rule` (not enforced)

  when: guard=blocked
  would catch 0 of 1598 recorded event(s) (0%) across 0 session(s)

  Nothing was enforced. Enforcement is a separate, deliberate step once a rule looks right.

Tune it until the counts look right

  1. Widen or narrow the rule with more --match conditions until the counts look right. A rule with no conditions matches nothing, by design.
  2. Check the sample lines: they are the metadata a match would act on, never a request body.
  3. Enforcement is a separate, deliberate step. Simulating never blocks anything.
$ surfil policy simulate --match measured=true
  when: measured=true
  would catch 21 of 1598 recorded event(s) (1%) across 2 session(s)

  sample (metadata only, never a body):
    · guard=clean measured=true model=claude-opus-4-8 input_tokens=704 output_tokens=14
    · guard=clean measured=true model=claude-opus-4-8 input_tokens=22724 output_tokens=524
Guard itself is not a mode you switch. It screens every intercepted request for credentials and injection patterns and refuses the ones that carry them, fail-closed, always - that is the blocked count on your Security page. What simulate gives you is a way to try a rule of your own against real recorded events first.

For fleet-wide policy across many devices, admins can simulate before enforce centrally - see the policy simulate runbook.