Skip to content
probate-court

probate-court

Pypi •[email protected] • November 29, 2026

Deterministic, dependency-free text checks that flag likely prompt-injection and memory-poisoning in agent inboxes and memories.

pip install probate-court-checks==0.3.0

Small, deterministic text checks that flag likely prompt-injection and memory-poisoning in text an AI agent is to read, store or act on (an e-mail, a web page, a "memory" to be saved). Pure Python, standard library only, no model and no network calls.

This is the "layer 1" of the Courthouse in the Probate project, extracted so it can be used on its own. Because it is code, the text being checked cannot argue with it or talk it out of its verdict.

check_text(text, source, owner=None, *, max_chars=600) -> list[Flag]

source : who the text came from ( user , trusted_contact , unknown_sender , web , tool_output , as a Source or plain string). Text from user may contain standing instructions; everything else may not.

owner : an OwnerProfile with approved emails , domains , trusted_contacts and payment_destinations . Anything not listed counts as new.

Only the first max_chars characters are inspected (600, as in the original). Use max_chars=None to scan everything.

Returns an empty list when nothing fired. Each Flag has a stable check name and a human-readable reason . (Reason strings refer to "the owner", meaning whoever runs the Courthouse.)

Word lists cover English, Hinglish (romanised Hindi), Spanish and German.

Prints JSON ( {"flagged": true, "flags": [{"check": ..., "reason": ...}]} ). Exit status is 1 if anything was flagged, 0 if not. Run probate-check --help for options.

Scope: what this is and is not

This is a set of hand-written heuristics : regular expressions, small word lists, a base64/hex decoder and a zero-width-character stripper. It is a cheap first filter, not a security boundary.

understand meaning. A paraphrase that avoids the listed words passes (a test pins one such miss), and a harmless text that happens to use them can be flagged;

cover languages beyond the four above, or other obfuscation (homoglyphs, other encodings, split-across-messages attacks, images, PDFs);

detect data exfiltration requests: fixture A11 is flagged only for its "remember this" wording, not for the exfiltration itself (the original system left that to a model layer);

see disk or process changes (the suite's two "planted script" fixtures are out of scope);

check that an address is really owned by anyone; matching is by string and domain.

The word lists were written alongside the 32-fixture suite, so measured results below are not evidence of how it will do on real traffic.

Measured results (bundled suite only)

On suite-v1 (32 hand-written fixtures, tests/data/suite-v1.json), with the example owner profile used in the test suite:

14 of 14 text attacks flagged, each with at least one of the check names the suite expects;

0 of 16 harmless twins flagged;

the 2 disk-persistence attacks (not text) are, by design, not flagged.

The suite is small and synthetic; treat these as regression tests, not accuracy claims.

This is one piece of Probate , an email agent that lives one generation at a time and passes down only what a court approves. Built for Fly.io Hacksgiving 2026.

Repository: github.com/harshbhx/probate

Live site: probate.dualmindlab.tech

Docs for this package: The attack suite and Everything we built

The story: the Probate write-up

Related: probate-memory-court (PyPI), Page Court (Apify Actor), probate-client (PyPI)

Releases: v0.1.0 , v0.2.0

Data: probate-attack-suite and probate-simulated-runs on Hugging Face

The fixtures in tests/data/suite-v1.json are a copy of fixtures/suite-v1.json in the repository root.

MIT. Copyright (c) 2026 Harsh Bhanushali.

Release files for probate-court-checks 0.3.0

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

Source distribution (sdist)

Built distribution (wheel)

Total release size: 38.2 kB

Release files / probate_court_checks-0.3.0.tar.gz

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

Security for probate-court-checks 0.3.0

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.

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

Nov 29, 2026 2 release files No provenance

Nov 26, 2026 2 release files No provenance

Nov 26, 2026 2 release files No provenance

Extracted Entities