Multicorn Shield - Python Client
Python client for Multicorn Shield, the open-source AI agent governance platform.
Install
pip install multicorn-shield
Quick start
from multicorn_shield import ShieldClient
client = ShieldClient(api_key="mcs_your_key_here")
result = client.log_action(
agent_id="your-agent-uuid", # from the dashboard or list_agents()
service="gmail",
action_type="send_email",
cost=2, # 2 cents
metadata={"recipient": "user@example.com"},
)
print(result.status) # APPROVED, BLOCKED, PENDING, etc.
The client also works as a context manager:
with ShieldClient(api_key="mcs_your_key_here") as client:
agents = client.list_agents()
for agent in agents:
print(f"{agent.name} ({agent.status})")
Async usage
import asyncio
from multicorn_shield import AsyncShieldClient
async def main():
async with AsyncShieldClient(api_key="mcs_your_key_here") as client:
result = await client.log_action(
agent_id="your-agent-uuid", # from the dashboard or list_agents()
service="gmail",
action_type="send_email",
)
print(result.status)
asyncio.run(main())
API methods
| Method | Description |
|---|---|
log_action(agent_id, service, action_type, ...) |
Submit an action to the policy engine (cost in cents) |
get_agent(agent_id) |
Fetch a single agent by ID |
list_agents() |
List all agents visible to your API key |
list_scopes(agent_id) |
List all permission scopes for an agent |
check_scopes(agent_id, service) |
Check resolved permissions for an agent on a service |
get_spending(agent_id) |
Fetch spending limits for an agent (values in cents) |
Both ShieldClient and AsyncShieldClient expose the same methods. The async variant returns coroutines.
TypeScript SDK
The TypeScript SDK has additional features not yet available in the Python client:
- Consent screens (Shadow DOM web component)
- MCP adapter (middleware for MCP tool call interception)
- MCP proxy (wrap any MCP server with zero code changes)
- Client-side spending enforcement with integer-cents arithmetic
Documentation
Full docs at multicorn.ai/shield.
Licence
MIT - Multicorn AI Pty Ltd
Metadata
Release files for multicorn-shield 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| multicorn_shield-0.1.0.tar.gz | 7.4 kB | Without provenance | Details for multicorn_shield-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| multicorn_shield-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for multicorn_shield-0.1.0-py3-none-any.whl |
Total release size: 14.3 kB
Release files / multicorn_shield-0.1.0.tar.gz
| Download URL | multicorn_shield-0.1.0.tar.gz |
|---|---|
| Size | 7.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
78a083977f400746fad88982962b9802fcaf97467087b90c290a54aa95521e76
|
|
BLAKE2b-256 checksum How to use checksums |
a9b05dfbe916f3cac1f41674ed2c8fc8a3bb32bba8696874fe4d604806e3f08f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Release files / multicorn_shield-0.1.0-py3-none-any.whl
| Download URL | multicorn_shield-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8e2fd64ddae2b20af009a5b9d464f0dee47c70dea20bb0bc648fab930524cd5d
|
|
BLAKE2b-256 checksum How to use checksums |
3806f61ef1dc44d39b7ea341a4d4db10aeb3ca4a0eb2224af0b28c65b1c6b244
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Security for multicorn-shield 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.