Skip to main content
Prerequisites. A VisIQ account (sign in) with a harness key from Settings → Harness Keys, Python 3.9+, and a model provider key for AutoGen (the sample calls a hosted model — any provider works). Full setup and fixes: Before you start · Troubleshooting.
Add action governance, retrieval governance, and a full audit trail to a AutoGen agent. The visiq wheel — published on PyPI, compiled from the same governance core as the TypeScript harness — makes every decision locally, in-process against a cached rule bundle. You construct a Governor and route each tool call through its gate: a policy deny raises ToolBlocked and a mask verdict hands your callback only the redacted arguments.

Install

Set environment variables

.env
The visiq wheel reads its configuration from the process environment and does not auto-load a project .env — export the variables (or load them yourself) before constructing the Governor.

Govern your tools

Wrap each tool body in the gate, then wire the governed callables into AutoGen’s native tool surface (FunctionTool.run_json):
AutoGen interception surface. AutoGen wraps a callable in FunctionTool and dispatches it via run_json; wrapping the callable with governed(...) routes every run_json through the gate. The governed(...) wrapper preserves each tool’s real signature (via functools.wraps) so the framework still builds a correct per-parameter schema.

What happens at runtime

New agents start in monitor mode (observe-only) until you flip them to enforce on the Harness → Agents page.
  • Decisions are local. The SDK fetches one cached rule bundle (GET /rules/bundle, ETag revalidation) and refreshes it in the background. Tool calls evaluate in-process; the only decision-path network call is waiting on a human approval.
  • Fail-open by default, loudly — strict deny is opt-in. Real policy outcomes always enforce: an explicit rule deny, the operator kill-switch, and an in-core mask/redact that cannot be applied (it downgrades to deny) all block. But a harness-internal failure — an unreachable backend, the governance core unavailable — by default proceeds with a loud [VisIQ] FAIL-OPEN stderr report so a VisIQ outage never disrupts your agent (owner decision, 2026-07-15). Set VISIQ_FAIL_MODE=closed to make those harness-internal failures deny instead.
  • Deny blocks the call. gate_tool raises ToolBlocked before the body runs, so the tool is never executed; catch it and return the reason to the model.
  • Approvals pause the call. An approval_required decision holds the tool while a human decides via Slack or Email (Microsoft Teams delivery is built server-side; its connector card is coming soon) — the SDK polls for up to 120 seconds (VISIQ_HITL_TIMEOUT_MS), then fails closed.
  • Mask proceeds, redacted. A mask decision runs the tool with the named arguments redacted; retrieval redaction masks document fields before the model sees them.
This is the manual per-tool Governor pattern. A turnkey one-call visiq()-style plugin for AutoGen is not yet published — you wire each tool through gov.gate_tool(...) yourself, exactly as shown above. The visiq wheel that makes the decisions is published today; the one-call auto-wrapper is coming, matching this framework’s “coming soon” connector card.

Verify it’s working

Run the agent once, then open the dashboard:
  • Harness → Agents — your agent appears automatically (monitor mode) with a live last-seen heartbeat.
  • Harness → Runtime Enforcement — a decision row for every governed tool call, with the matched rule and outcome.

Next steps

Full Quickstart

All supported frameworks and what happens behind the scenes.

Python SDK Reference

The complete Governor API — gate_tool, gate_documents, fail modes.