Skip to main content

firstwatch

First line of defence for AI agents. Scans pages, files and tool results for attacks aimed at agents (in the text people see and the text they don't), and records each one as evidence in an open, OpenTelemetry-ready format with MITRE ATLAS and OWASP IDs.

No dependencies. Python 3.9+.

pip install firstwatch
from firstwatch import scan, watch

scan(page_html)
# {"level": "stop", "findings": [{"rule": "exfiltrate-secrets", "hidden": True,
#   "hidden_how": ["css:tiny-text"], "atlas": ["AML.T0086", ...], ...}]}

result = watch(page_html, url=url, tool="fetch")   # scan + save a capture on a stop
if result["level"] == "stop":
    ...  # don't hand the page to the model as instructions; tell the user

Command line:

firstwatch scan page.html
firstwatch list
firstwatch export otlp security-captures/<folder>/capture.json

It catches instruction overrides, role hijacks, orders to hide things from the user, requests to send secrets out, requests to reveal the system prompt, curl | sh in hidden text, markdown image data leaks, edits to the agent's own setup, and orders aimed at AI assistants. It looks in HTML comments, CSS-hidden elements, attributes, invisible Unicode tag characters, zero-width characters and base64.

The Node package (npm install firstwatch) uses the same rules and format, and adds Claude Code hooks that block actions after an attack.

Docs, examples and the capture format: https://github.com/dave8172/firstwatch

MIT licensed. Made by @dave8172.

Metadata

Release files for firstwatch 0.3.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 firstwatch 0.3.0
File Size Uploaded Provenance Actions
firstwatch-0.3.0.tar.gz 18.1 kB With provenance Details for firstwatch-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for firstwatch 0.3.0
File Interpreter ABI Platform Actions
firstwatch-0.3.0-py3-none-any.whl Python 3 none any Details for firstwatch-0.3.0-py3-none-any.whl

Total release size: 39.5 kB

Release files / firstwatch-0.3.0.tar.gz

Download URL firstwatch-0.3.0.tar.gz
Size 18.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d4a545a7335ee688c74b9b1d0d8e39db022785b82d057a3d0658fd8609628548
BLAKE2b-256 checksum
How to use checksums
83f1c603ff7ea643baf07f56cf2af40505730b5edd338033610e515676ef5de9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 30, 2026.

Transparency log

Release files / firstwatch-0.3.0-py3-none-any.whl

Download URL firstwatch-0.3.0-py3-none-any.whl
Size 21.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f0a81299add94a1b4aaba101061b1f5a81df98595969c450a4d0f28e3bf0fc77
BLAKE2b-256 checksum
How to use checksums
714f5a9bc35444146aff79a3631307b54fea9706a68f31c2d238e33027b46e0a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 30, 2026.

Transparency log

Security for firstwatch 0.3.0

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for firstwatch-0.3.0.tar.gz

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 Oct 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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