Skip to main content

watchlight-agent-sdk

Build governed AI agents. The Watchlight Agent SDK lets you put a real, fail-closed authorization decision in front of every action your agent takes — and record what happened — with the same code whether you run it on your laptop or across a production fleet.

pip install watchlight-agent-sdk

Import it as watchlight_core.

What it does

Your agent asks "may I do this?" before it acts; Watchlight answers Allow or Deny by evaluating your policies, and the action only runs if it's permitted. The SDK gives you:

  • Authorization — authorize_action(action, resource) gates every step, fail-closed.
  • Preflight — a cheap read-only "would this be allowed?" check.
  • Lifecycle — a RunHandle per agent run: submit a plan, authorize steps, complete or terminate.
  • Lineage — canonical, value-free execution events for audit and debugging.
  • Framework plugins — ready-made integrations for LangGraph, Google ADK, AWS Bedrock, Microsoft Agent Framework, Pydantic AI, and more.

The SDK is glue: it shapes a request, hands it to a Watchlight backend, and projects the answer. Every decision is made by the backend — never in this package — which is why it's open source (Apache-2.0).

Two backends, same code

The SDK talks to a backend through one small interface, so the exact same agent and plugin code runs against either:

Backend Runs
Developer Edition InProcessClient The compiled engine, in-process — no server, no network
Enterprise ApdpClient The governed control plane — signed lineage, drift detection, fleet-wide governance

Moving from one to the other is a one-line change, never a rewrite.

Quickstart — a governed decision, zero infrastructure

Install the in-process engine alongside the SDK:

pip install watchlight-agent-sdk watchlight-engine
import asyncio
from watchlight_core import InProcessClient

# A Cedar policy: the research agent may read, nothing else.
POLICIES = [
    {"name": "reader",
     "code": 'permit(principal == Agent::"research-agent", action == Action::"read", resource);'},
]

async def main():
    gov = InProcessClient(POLICIES)          # real engine decisions, in-process — no network
    print((await gov.authorize("research-agent", "read", "dataset"))["decision"])    # Allow
    print((await gov.authorize("research-agent", "delete", "dataset"))["decision"])  # Deny

asyncio.run(main())
Allow
Deny

That Deny is the point: the action is refused before it runs — by the same engine that powers the Watchlight platform, with no database and no network.

Govern a framework agent

Install the plugin for your framework and point it at a backend — your agent code doesn't change:

from watchlight_langgraph import WatchlightLangGraphPlugin   # or -adk, -bedrock, -pydantic-ai, …
from watchlight_core import InProcessClient

plugin = WatchlightLangGraphPlugin()
plugin.apdp = InProcessClient(POLICIES)      # the one line that differs from production

async with await plugin.start_run("research-agent") as handle:
    if not await handle.authorize_action("read", "dataset"):
        raise PermissionError("denied by policy")
    # ... your agent runs, every action governed ...

Custom agents (any framework)

For an agent not built on a supported framework, the @watchlight decorator governs any function:

from watchlight_core import InProcessClient, watchlight

gov = InProcessClient(POLICIES)

@watchlight(agent_id="custom-research", client=gov)
async def run_research(query: str) -> str:
    ...

Optional: OpenTelemetry export

Install the [otlp] extra to export a subset of the lineage stream to your OTel collector (off by default):

pip install 'watchlight-agent-sdk[otlp]'

Learn more

License

Apache-2.0.

Metadata

Release files for watchlight-agent-sdk 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for watchlight-agent-sdk 0.8.0
File Size Uploaded
watchlight_agent_sdk-0.8.0.tar.gz 348.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for watchlight-agent-sdk 0.8.0
File Interpreter ABI Platform
watchlight_agent_sdk-0.8.0-py3-none-any.whl Python 3 none any Details

Total release size: 565.2 kB

Release files / watchlight_agent_sdk-0.8.0.tar.gz

Download URL watchlight_agent_sdk-0.8.0.tar.gz
Size 348.9 kB
Tags Source
SHA-256 checksum
How to use checksums
e0720dde67c69fde29eebf6ddc6aaa91330b440f97ff1b62977429edb25d8768
BLAKE2b-256 checksum
How to use checksums
0f4e27c7d1cc6cd8ff9995d724c7b9bd2e7293a95b056d54f815cc18ee10b9d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 12, 2026.

Transparency log

Release files / watchlight_agent_sdk-0.8.0-py3-none-any.whl

Download URL watchlight_agent_sdk-0.8.0-py3-none-any.whl
Size 216.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6f750d04f033bd1efca71d932e471e91e9d57adcd397a0a1f8b5acb6c5e11e37
BLAKE2b-256 checksum
How to use checksums
a7221dc13796ca448ff2c8e3ffb7fb96d8d308ea772fea8744b808071d9fbb4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 12, 2026.

Transparency log

Release history Release notifications | RSS feed

0.9.4

2 release files

0.9.3

2 release files

0.9.1

2 release files

0.9.0

2 release files

This release

0.8.0 This release

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page