Skip to main content

Dye

Part of Boundary Lab.

Dye finds tool call arguments that were copied from text your chatbot read. Mark the text that came from outside your app, such as a support ticket, an email, or a web page. When the model proposes a tool call, Dye checks each argument against that text and reports the ones it finds, with the source they came from.

A model that reads "refund account 88214471 the sum of $420.00" inside a ticket may propose exactly that refund. Dye tells you the account and the amount came from the ticket, so your app or Latch can decide what happens next.

Dye needs no model, no network, and no packages beyond Python 3.11.

Try the demo

pip install boundary-dye
boundary-dye demo

Five scenarios run against Northwind, a made up utility. They cover a ticket that tells the agent to refund an account it names, a signed in account the app trusts, a quoted order number, an email address spelled out in words, and a one digit plan tier.

boundary-dye scenarios --json prints the same results as JSON.

Check a call from the command line

boundary-dye check --source ticket=ticket.txt --trust NW-100482 --args '{"account_id": "88214471", "amount_minor": 42000}'

The report lists each tainted argument, the value, the source label, and the matcher that found it. The command exits 1 when anything is tainted and 0 when nothing is. Repeat --source for more files and --trust for more values.

Use it in your app

from boundary_dye import Tracker

tracker = Tracker()
tracker.mark("ticket 4471", ticket_body)
tracker.mark("web page", page_text)
tracker.trust(session.account_id)

report = tracker.check(model_arguments)
if not report.clean:
    for finding in report.findings:
        print(finding.path, finding.value, finding.source, finding.matcher)

Make one Tracker per conversation. Mark text as it arrives, and trust the values your app already knows, such as the signed in account, so they are never reported even when the customer repeats them. report.tainted is the set of argument paths, such as account_id or items[0].sku. report.to_dict() gives JSON ready output.

How matching works

Dye compares each argument value with the marked text in two ways.

The text match lowercases both sides, collapses spaces, and looks for the value as a whole term, so 2 matches "tier 2" and not "22", and ORD-553 does not match "ORD-5531". Email addresses spelled out in words are matched too: "j dot doe at example dot com" matches j.doe@example.com.

The digits match applies to values made only of digits, with spaces, dots, commas or dashes between them. It compares the digits with each whole number in the text, so 42000 matches "$420.00" and 1107 does not match "2026-11-07".

Values the app trusted, None, booleans and empty strings are skipped. See how it works.

Use it with Latch

Latch checks tool calls before they run. Pass Dye's result in the UserContext and set tainted_arguments = "deny" for the tools that should never act on copied values. See using Dye with Latch.

See Release for how a version gets published.

Dye is licensed under AGPL-3.0-only. See LICENSE.

Metadata

Release files for boundary-dye 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 boundary-dye 0.1.0
File Size Uploaded Provenance Actions
boundary_dye-0.1.0.tar.gz 23.0 kB Without provenance Details for boundary_dye-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 43.2 kB

Release files / boundary_dye-0.1.0.tar.gz

Download URL boundary_dye-0.1.0.tar.gz
Size 23.0 kB
Tags Source
SHA-256 checksum
How to use checksums
20750ac79c060b14c8b08be15c911d3237b6f83b5279ba500d897a3908ecb589
BLAKE2b-256 checksum
How to use checksums
4e4bdcf7a51aec29254ace402a2c0f7a35ed1a0b6c89518b8900d28c0b4e8458
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.2

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

Download URL boundary_dye-0.1.0-py3-none-any.whl
Size 20.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d5e0e3ccb77f1f08a3df01713298e595aba97d819d11c497b9b132ca3663b903
BLAKE2b-256 checksum
How to use checksums
3d906baa094681c032a302c8d1f58e5532c70ccdc4a9e5fcfdd20143f3ff6041
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.2

Security for boundary-dye 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.

No provenance found

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.

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

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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