Skip to content

v0.3.2 : Catch them leaking your system prompt

Choose a tag to compare

@MaxMLang MaxMLang released this 14 Apr 13:25
· 2 commits to main since this release

v0.3.2 : Catch them leaking your system prompt

You can detect injections, scan for PII, and filter toxicity, but what happens when the model spits out your entire system prompt? This release adds canary tokens to catch exactly that, plus proper third-party licensing disclosure.

What's new

Canary Tokens : CanaryToken injects a unique secret token into your system prompt and checks whether the model repeats it. If the canary shows up in the output, your system prompt was leaked — regardless of how clever the injection technique was. Works with any LLM, any framework. Zero dependencies, zero calibration, pure stdlib.

Licensing disclaimer : The README and a new NOTICE file now clearly separate pytector's Apache 2.0 license from the licenses of the third-party models it uses at runtime (e.g. PasteProof's BSL 1.0). Users deploying commercially should check upstream model licenses.

Good to know

CanaryToken is pure Python stdlib — no new dependencies, no model downloads, no config. Import it, wrap your system prompt, check the output. That's it.

The canary is a detection mechanism, not a prevention one. It tells you after the fact that a leak happened. Pair it with PromptInjectionDetector and PromptSanitizer for defense in depth.

The NOTICE file lists all third-party models with their licenses and Hugging Face URLs. This is the Apache 2.0 convention for disclosing bundled or runtime dependencies.

Other changes

Fixed setup.py classifier from MIT to Apache Software License — was a leftover from pre-v0.2.0.

Updated docs (api, examples, quickstart, index) and README with canary token usage examples.

Full docs: pytector.readthedocs.io