Skip to main content

AI Cordon

PyPI License: Apache 2.0 Python Dependencies

Find prompt injections in the text your model reads: mail, pages, tool results, retrieved chunks.

Two detectors with the same Python API and CLI.

Picket — fast Intent — accurate
what it is a signature rule, runs in your process the full AI Cordon detector, over an API
speed 100–200 documents a second on one CPU core a network round trip per document
false alarms ~1 in 1 000 clean documents ~1 in 10 000 clean documents (FPR 1e-4)
catches known phrasings: "ignore previous instructions", "reveal your system prompt" instructions in any wording, including ones hidden in markup
needs nothing: no model, no network, no key an API key
your text never leaves the process: Picket has no network code is sent to the AI Cordon API to be judged
details docs/picket.md docs/intent.md

Picket: bulk scanning, ingest pipelines, mail gateways, offline use. Intent: where a missed injection is expensive. They can be combined: Picket on everything, Intent on what matters.

Quick start

$ pip install aicordon
$ aicordon picket scan letter.txt          # local, works right away
$ aicordon login                           # once: stores the Intent API key
$ aicordon intent scan letter.txt
from aicordon import picket, intent

fast = picket.load()
full = intent.load()          # key: api_key=..., AICORDON_API_KEY, or `aicordon login`

for det in (fast, full):
    rep = det.check(text)
    if rep.flagged:
        for f in rep.findings:
            print(det.title, f.threat, text[f.span[0]:f.span[1]])

A report lists findings with their positions. No findings does not mean no injection.

Both on the same five texts

python examples/compare.py runs both over examples/texts:

text                         Picket (local rule)              Intent (API)
01-obvious-email.txt         alarm  IPI/Secret.Reveal.C       alarm  score 0.98
02-support-ticket.txt        —                                alarm  score 0.98
03-release-notes.html        —                                alarm  score 0.99
04-warning-question.txt      —                                —      score 0.40
05-quarterly-report.txt      —                                —      score 0.11

Both flag 01. Texts 02 and 03 contain no known phrasing, so only Intent flags them. Text 04 is an ordinary question that contains "ignore" and "previous instructions"; neither detector flags it.

Licensing

Apache License 2.0 (LICENSE), including the Picket rule base. Contributions are accepted under the DCO: sign off your commits with git commit -s.

Get an Intent key at ai-cordon.com.

Metadata

Release files for aicordon 1.4.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 aicordon 1.4.0
File Size Uploaded
aicordon-1.4.0.tar.gz 1.4 MB Details

Built distribution (wheel)

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

Total release size: 1.9 MB

Release files / aicordon-1.4.0.tar.gz

Download URL aicordon-1.4.0.tar.gz
Size 1.4 MB
Tags Source
SHA-256 checksum
How to use checksums
d84182fc53c239055afcc20509034570e9c9823f1b56c82613b845962143be7e
BLAKE2b-256 checksum
How to use checksums
f9b45ad831ff25d6f01be267af19f9180b24b2fff57a4ce76e4cd9c9de14a46c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.17

Release files / aicordon-1.4.0-py3-none-any.whl

Download URL aicordon-1.4.0-py3-none-any.whl
Size 530.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0eafd96042c6ef9d41f6f05782c952697537681b532ee152d508600e7cdcb11a
BLAKE2b-256 checksum
How to use checksums
c1010a3df3d245f7eb5a8bc2d363adc482db0384fbfbcdf6ec853a4d054b59e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.17

Release history Release notifications | RSS feed

This release

1.4.0 This release

2 release files

1.3.0

2 release files

1.2.1

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.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