Official Governance AI Agent Guardrails SDK for Python agents and tool execution
Project description
Governance AI Agent Guardrails SDK for Python
SDK oficial para instrumentar agentes, tools y pasos LLM con Governance AI Agent Guardrails.
Publicacion objetivo en PyPI:
pip install governanceai-guardrails-agent
Import principal:
import agent_control
from agent_control import ControlViolationError, ControlSteerError, control
API cubierta
POST /agent-guardrails/runtime/agents/initGET /agent-guardrails/runtime/agents/{agent_name}/controlsPOST /agent-guardrails/runtime/evaluatePOST /agent-guardrails/runtime/events
Autenticacion
El SDK usa:
app_numberen requestsAuthorization: Bearer <APP_API_KEY>
Puedes configurar por argumentos o por variables:
AGENT_CONTROL_URLAGENT_CONTROL_APP_NUMBERAGENT_CONTROL_APP_API_KEY
Quick start
import asyncio
import agent_control
from agent_control import ControlViolationError, control
@control("query_db", step_type="tool")
async def query_db(query: str, context: dict | None = None) -> str:
return f"Executed: {query}"
async def main() -> None:
agent_control.init(
agent_name="support_bot",
agent_description="Customer support automation",
base_url="https://api.governanceai.example",
app_number=123456,
app_api_key="ga_live_replace_me",
default_metadata={"environment": "production"},
)
try:
print(await query_db("SELECT * FROM tickets", context={"tenant": "acme"}))
except ControlViolationError as exc:
print(f"Blocked by {exc.control_name}: {exc.message}")
asyncio.run(main())
Que resuelve
- Registro del agente y sus pasos
- Decoradores
@control()para pasos sync/async - Evaluacion
preypostpor step - Eventos de ejecucion, bloqueo, steering y error
- Metadata runtime por trace/span
Errores, timeout y retry
AgentControlClient soporta:
timeout_secondsmax_retriesretry_backoff_secondsretry_status_codes
Errores del cliente:
AgentControlErrorstatus_coderesponse_body
Tests y release
Instalacion editable:
pip install -e ./sdk/python-agents
Tests:
python -m pytest ./sdk/python-agents/tests
Build:
python -m build ./sdk/python-agents
Publicacion:
python -m twine upload dist/*
Semver y changelog
- Version actual:
0.1.0 - Historial:
CHANGELOG.md - Licencia:
LICENSE
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file governanceai_guardrails_agent-0.1.0.tar.gz.
File metadata
- Download URL: governanceai_guardrails_agent-0.1.0.tar.gz
- Upload date:
- Size: 12.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7451d03c4415b529ed44e92e02e476285050d518da266869d0419c98c0009a67
|
|
| MD5 |
edd4118b97aaf40b486028d40c8bed20
|
|
| BLAKE2b-256 |
bf390f97929e20fad6dd1b768b047987f7b4d54a7e612b6ead54da95c6f0e768
|
Provenance
The following attestation bundles were made for governanceai_guardrails_agent-0.1.0.tar.gz:
Publisher:
publish-pypi.yml on l33tm3/governanceai-guardrails-agent
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
governanceai_guardrails_agent-0.1.0.tar.gz -
Subject digest:
7451d03c4415b529ed44e92e02e476285050d518da266869d0419c98c0009a67 - Sigstore transparency entry: 1154886778
- Sigstore integration time:
-
Permalink:
l33tm3/governanceai-guardrails-agent@2cf0b2dcd3197f10a163d7ca0c873b6a8b40ba54 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/l33tm3
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@2cf0b2dcd3197f10a163d7ca0c873b6a8b40ba54 -
Trigger Event:
push
-
Statement type:
File details
Details for the file governanceai_guardrails_agent-0.1.0-py3-none-any.whl.
File metadata
- Download URL: governanceai_guardrails_agent-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b28ff739d052887c1001b65de4384d24ae896896981893a8a35ff96abeae6f41
|
|
| MD5 |
d3b3a3345deaee6d6183154c25ad7c50
|
|
| BLAKE2b-256 |
2457e4361324a06e660d0c1d2fda373253daa32c7fe9bd92b2fdfdf025a01652
|
Provenance
The following attestation bundles were made for governanceai_guardrails_agent-0.1.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on l33tm3/governanceai-guardrails-agent
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
governanceai_guardrails_agent-0.1.0-py3-none-any.whl -
Subject digest:
b28ff739d052887c1001b65de4384d24ae896896981893a8a35ff96abeae6f41 - Sigstore transparency entry: 1154886782
- Sigstore integration time:
-
Permalink:
l33tm3/governanceai-guardrails-agent@2cf0b2dcd3197f10a163d7ca0c873b6a8b40ba54 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/l33tm3
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@2cf0b2dcd3197f10a163d7ca0c873b6a8b40ba54 -
Trigger Event:
push
-
Statement type: