Skip to content

Verdict

agent_gate.verdict

Verdicts and how they combine.

A verdict is pass (say nothing, leave the call to Claude Code's normal permission flow), ask (a person must confirm) or deny. There is no allow: the gate can only make the flow stricter.

Verdict(decision, law=None, reason='', layer='rules') dataclass

The gate's answer for one action.

Parameters:

Name Type Description Default
decision Decision

pass, ask or deny.

required
law int | None

the law that decided it, 1-5, or None.

None
reason str

one sentence; shown to the agent on deny, to the person on ask.

''
layer str

which layer decided: rules, history, model or gate.

'rules'

strictest(*verdicts)

Return the strictest verdict; the first wins a tie.

Parameters:

Name Type Description Default
verdicts Verdict

one or more verdicts.

()
Source code in src/agent_gate/verdict.py
37
38
39
40
41
42
43
44
45
46
def strictest(*verdicts: Verdict) -> Verdict:
    """Return the strictest verdict; the first wins a tie.

    :param verdicts: one or more verdicts.
    """
    best = verdicts[0]
    for verdict in verdicts[1:]:
        if _RANK[verdict.decision] > _RANK[best.decision]:
            best = verdict
    return best