Core Features
Policy Engine
Define and enforce governance policies for AI agents using declarative YAML configuration.
Overview
The Policy Engine evaluates every action against your defined rules before execution. Policies can ALLOW, BLOCK, WARN, or require APPROVAL for specific actions.
Permit the action
Reject the action
Allow but flag
Require human review
Policy Configuration
Define policies using human-readable YAML:
Checking Policies
Check if an action is allowed before execution:
This is a cloud feature — @torknetwork/sdk
Hosted policies and approval routing are evaluated server-side, so the outcome is recorded as capture_mode=cloud, attested_by=tork. The TorkClient class below comes from @torknetwork/sdk (npm, v2.0.0) — a different package from the on-device tork-governance, which exports Tork and has never exported TorkClient. There is no Python cloud SDK: from Python, call the REST API directly.
From Python there is no cloud client class — call the same endpoint over HTTP with a Bearer token:
Dynamic Policy Evaluation
Policies can use dynamic conditions based on context:
Pro Tip: Test policies in development before deploying to production. Use client.policy.test() to simulate evaluations.