Skip to main content

agentshield-gateway-sdk

Python client for the AgentShield Tool Security Gateway. Call evaluate() from inside your agent's tool-calling loop before it actually runs a tool, and act on the decision AgentShield returns.

Install

Once published to PyPI, anyone can install it with no local files at all:

pip install agentshield-gateway-sdk

Until then (or for local development), install from a local checkout of the AgentShield repo:

pip install /path/to/agentshield/sdk
# or, for local development (picks up edits without reinstalling):
pip install -e /path/to/agentshield/sdk

Or from git, without cloning first:

pip install "git+https://github.com/<org>/<repo>.git#subdirectory=sdk"

All three install the same distribution, agentshield-gateway-sdk, which provides the importable module sdk (matching the code snippet shown in the dashboard's "Get gateway credentials" step) - the import is identical no matter which install method you used.

Get a credential first

The client needs a gateway credential for the specific agent it's acting on behalf of. Get one from the dashboard: Add Agent → Connect its tools → Get gateway credentials (step 6 of onboarding), or via the API: POST /v1/agents/{id}/credentials. The token is shown only once - store it securely (e.g. an environment variable), not in source control.

Usage

import os
from sdk.client import AgentShieldClient
# or: from sdk import AgentShieldClient

shield = AgentShieldClient(
    base_url="https://your-agentshield-host",
    credential=os.environ["AGENTSHIELD_CREDENTIAL"],
)

result = shield.evaluate(
    tool="email.send",
    action="send",
    target="customer@example.com",
    data_classification="confidential",
)

if result.allowed:
    ...  # actually send the email
else:
    print(f"{result.decision}: {result.reason}")
    # handle BLOCK / REQUIRE_APPROVAL / QUARANTINE - do not proceed

evaluate() returns an EvaluationResult with decision, risk_score, risk_breakdown, policy, reason, and the allowed convenience property (True only when decision == "ALLOW").

Metadata

Release files for agentshield-gateway-sdk 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 agentshield-gateway-sdk 0.1.0
File Size Uploaded Provenance Actions
agentshield_gateway_sdk-0.1.0.tar.gz 4.0 kB Without provenance Details for agentshield_gateway_sdk-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for agentshield-gateway-sdk 0.1.0
File Interpreter ABI Platform Actions
agentshield_gateway_sdk-0.1.0-py3-none-any.whl Python 3 none any Details for agentshield_gateway_sdk-0.1.0-py3-none-any.whl

Total release size: 8.4 kB

Release files / agentshield_gateway_sdk-0.1.0.tar.gz

Download URL agentshield_gateway_sdk-0.1.0.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
9a360b66ba375c300aa9c26bdd31dade2041eb8442c7ed3f16ee9bb25d463eaa
BLAKE2b-256 checksum
How to use checksums
1c703ddd8f5c68e91104a263633d39589e5281ea2808ff65fef816c372493fb1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

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

Download URL agentshield_gateway_sdk-0.1.0-py3-none-any.whl
Size 4.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a9db3ebb02002262dc82d6125c37433e8bd234930c17381d6a91a4347b44569f
BLAKE2b-256 checksum
How to use checksums
dca7a2268a2c60c056952665e9e9e7690cde846aefcff77bcb0e194b9d04b902
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Security for agentshield-gateway-sdk 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