Skip to main content

mayi logo

mayi

The agent proposes. Your rules decide.

tests PyPI Python license

An injected refund of 9000 is held while a refund of 40 runs

mayi (as in "may I?") enforces who controls each argument of an AI agent's tool call. Permissions usually say which tool an agent may call. They do not say which value it may pass, so refund(40) and refund(9000) look the same. mayi sits between the agent and your tools and gives every argument one owner:

Owner What happens
application your app supplies the value; whatever the model proposed is thrown away
model free text, checked for type, length, allowlists and forbidden content
human a single-use, expiring approval, or a bounded limit with a session budget
derived computed by a formula a human wrote

The rules are plain code. There is no second model judging the first. Anything not in the catalog is rejected.

Try it

pip install mayi
mayi demo

Open the console at http://127.0.0.1:8787/console (key: demo-app-key). To watch a real Claude model get a hidden attack, run mayi try-model in a second window with ANTHROPIC_API_KEY set.

Use it with your own tools

mayi init                  # writes catalog.yaml and tools.json
mayi check catalog.yaml    # validate your rules
mayi serve                 # prints an agent key and an app key

Edit catalog.yaml to say who controls each argument. Your app opens a session with the values it controls; the agent calls POST /v1/call; held calls wait in the console for a person. More in the guide.

Results

Test Without mayi With mayi
AgentDojo banking, 9 injection tasks (replayed) 9 / 9 succeed 0 / 9
InjecAgent, 2,108 attack cases (replayed) 2,108 / 2,108 0 / 2,108
Live Claude Haiku 4.5, 64 runs 8 ran 0

The replayed tests measure what happens after a fooled agent proposes the call, not how often models are fooled. The live test used two models and eight injections written by the author. Details, including where it did not help, are in the guide.

Works with

Tested: the official MCP Python client (SDK 1.30 and 2.2) through mayi mcp-proxy, the OpenAI Agents SDK, CrewAI, LangGraph and the Anthropic SDK. Not yet tested: Claude Desktop, Claude Code, Cursor and other MCP hosts. Reports from people who try them are welcome.

What is included

  • Gateway with an audit log and a console; MCP proxy that puts any MCP server behind the same rules
  • Single-use approvals signed with HMAC or Ed25519, two-person approval, session budgets, rate limits
  • mayi prove to check a catalog for broken invariants, with counterexamples
  • Adapters for the OpenAI Agents SDK and CrewAI, and a TypeScript client

Limits

  • No outside security review yet. Do not use mayi alone to protect tools that move money.
  • It checks free text the model writes but does not judge what it means.
  • The copied-value check is a heuristic. Paraphrased, translated or spelled-out values get through.
  • It is not a new idea. Progent and CaMeL came first; the guide compares them.

Run the tests

pip install pytest hypothesis && python3 -m pytest -q

Contributing and security

See CONTRIBUTING.md and the roadmap. To report a vulnerability, read SECURITY.md.

License

Apache-2.0. See LICENSE.

Metadata

Release files for mayi 0.2.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 mayi 0.2.0
File Size Uploaded Provenance
mayi-0.2.0.tar.gz 98.2 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 171.8 kB

Release files / mayi-0.2.0.tar.gz

Download URL mayi-0.2.0.tar.gz
Size 98.2 kB
Tags Source
SHA-256 checksum
How to use checksums
eee0d0ffc4baaddad5bd3acae16f366cd813d8356a913727e9bd3b01af6eab1d
BLAKE2b-256 checksum
How to use checksums
748f395b097e742e2aead7c1a415c6603b8db392409406281fba2f60c27e725c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / mayi-0.2.0-py3-none-any.whl

Download URL mayi-0.2.0-py3-none-any.whl
Size 73.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
409edf5d5ab77adbd3ae894ea98d772dad24c1f831d629a14cb4dcda2ee7f112
BLAKE2b-256 checksum
How to use checksums
708b53f9b6365ea0b15e90f9f812888afb1181a9654fdc073c597e186de1775d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Security for mayi 0.2.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.

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