Skip to main content

crewai-relayshield

A pre-execution gate for CrewAI. Before an agent connects to an MCP server or installs a tool it found on its own, RelayShield is asked about the target, and the call is refused if the answer is bad.

pip install crewai-relayshield
from crewai_relayshield import install

install()   # registers a before_tool_call hook with CrewAI

That is the whole integration. The hook fires only for tools that connect or install something (DEFAULT_PROTECTED_TOOLS); pass tools=[...] to name your own.

What it does

install() registers a before_tool_call hook. When a protected tool is about to run, the gate pulls the target out of the tool's arguments, calls RelayShield's mcp-registry-risk check, and maps the answer to one of four actions:

Check said Action Tool call
a finding DENY blocked
nothing known against it ALLOW proceeds
unknown, or only partly checkable REVIEW blocked
the check itself failed DEFER blocked (see below)

Returning False from a CrewAI before-hook aborts the call, which is what blocking means here.

Fail-closed by default, and why

Only ALLOW proceeds. A gate that lets the call through when the check fails is not a gate: anyone who can cause a timeout or a 429 has removed it, and those are cheap to cause.

That does couple your agent's availability to ours, which is a real cost and your decision rather than ours:

install(fail_open=True)

fail_open releases DEFER only, meaning a check that could not be completed. A completed check that said REVIEW still blocks, and a FINDING always blocks. There is no setting that lets a known-bad target through.

Without CrewAI

The decision path has no framework import, so you can use it behind any pre-execution chokepoint, or test it on its own:

from crewai_relayshield import decide

allowed, decision = decide({"server_url": "https://example.invalid/mcp"})
print(allowed, decision.action, decision.reason_codes)

What it never claims

The check reports what is known against a target. "No known finding" is an absence of evidence, not proof that something is safe, and this package does not upgrade one into the other anywhere in its output.

Configuration

Env var Meaning
RELAYSHIELD_API_KEY subscription key; without it the API answers 402 and the gate defers
RELAYSHIELD_API_URL override the API base (defaults to https://api.relayshield.net)

Get a key, including a free tier: https://api.relayshield.net/developers?source=pypi

Licence

MIT.

Metadata

Release files for crewai-relayshield 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 crewai-relayshield 0.1.0
File Size Uploaded Provenance Actions
crewai_relayshield-0.1.0.tar.gz 11.9 kB Without provenance Details for crewai_relayshield-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for crewai-relayshield 0.1.0
File Interpreter ABI Platform Actions
crewai_relayshield-0.1.0-py3-none-any.whl Python 3 none any Details for crewai_relayshield-0.1.0-py3-none-any.whl

Total release size: 22.1 kB

Release files / crewai_relayshield-0.1.0.tar.gz

Download URL crewai_relayshield-0.1.0.tar.gz
Size 11.9 kB
Tags Source
SHA-256 checksum
How to use checksums
98ebc29bfb83fa3977c8b2134970faa8c12897c38c5a653ba30387c99848e938
BLAKE2b-256 checksum
How to use checksums
e1ffdd764281e0b087e635e042689fee03e4408afeff69f94852d20f07daf3a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.5

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

Download URL crewai_relayshield-0.1.0-py3-none-any.whl
Size 10.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2ecd76cf54f532aeea29f9ac696e7aa3440e531f80087a5c04dbbdf3b556129a
BLAKE2b-256 checksum
How to use checksums
91279e09ef0843fb55ee7d32bfa137b67548cf2ded56d4370e07ee308da27568
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.5

Security for crewai-relayshield 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