Skip to content

@intutic/gate / core / Gate

Class: Gate ​

The pre-execution gate. Gate.guard evaluates one tool call against the local tiers (SSO group policy, policy snapshot, MCP servers, image integrity) and, with a GateClient, the control-plane tiers (SOP rules, hook gate), and throws IntuticGateRefusal to refuse it. Without a client only the local tiers run.

Constructors ​

Constructor ​

ts
new Gate(cfg?, client?): Gate;

Parameters ​

ParameterTypeDefault value
cfgGateConfig{}
clientGateClient | nullnull

Returns ​

Gate

Properties ​

PropertyModifierType
cfgreadonlyResolvedConfig
clientreadonlyGateClient | null

Methods ​

getPolicy() ​

ts
getPolicy(): ImagePolicy;

Load the image allowlist.

A missing or malformed allowlist is NOT treated as "allow everything". An empty policy with require_digest still refuses every unpinned image, which is the safe direction; a policy we cannot read at all throws, and the caller turns that into a block.

Returns ​

ImagePolicy


getSnapshot() ​

ts
getSnapshot(): Snapshot;

Returns ​

Snapshot


getSopRules() ​

ts
getSopRules(): Promise<SopRule[]>;

Active SOP rules, fetched once per process.

Deliberately not refreshed on a timer: a rule set that changes mid-run makes a verdict depend on when the fetch landed. Construct a new Gate (or clear the cache) to refresh.

Returns ​

Promise<SopRule[]>


guard() ​

ts
guard(toolName, toolInput): Promise<void>;

Throws IntuticGateRefusal if this call must not run. Resolves to allow.

Under a chaos run's plan, the call is reported to the run's events file whatever the tiers decide, and a call they allowed can still be refused by the fault that is due (CHAOS_FAULT, or IntuticGateHold for a held one). A plan that is set but unreadable refuses every call: an experiment run without the faults it asked for reports a resilience it never measured.

Parameters ​

ParameterType
toolNamestring
toolInputToolInput

Returns ​

Promise<void>

The circuit breaker for AI agents