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.1.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.1.0
File Size Uploaded Provenance Actions
firstwatch-0.1.0.tar.gz 16.0 kB With provenance Details for firstwatch-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 35.3 kB

Release files / firstwatch-0.1.0.tar.gz

Download URL firstwatch-0.1.0.tar.gz
Size 16.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c92ea1fd334eaec9f178bb6db0441767f81e48151d04b210a8076550b3f7f65b
BLAKE2b-256 checksum
How to use checksums
82e70f2cf2fa105615c7bdb7721473566206b5e33029a33033b24b080b7f4b90
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 29, 2026.

Transparency log

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

Download URL firstwatch-0.1.0-py3-none-any.whl
Size 19.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b81518960b8d4504ce466c85a7dbb8886d5a5649d593e21499b2be424bef7423
BLAKE2b-256 checksum
How to use checksums
32076aa18d67dea883ea9542d8e39d5408fe55604cfdf7a6d5f6db0685078150
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 29, 2026.

Transparency log

Security for firstwatch 0.1.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.1.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 29, 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