Agent Control Evaluator - Cisco AI Defense
External evaluator that calls Cisco AI Defense Chat Inspection via REST and maps InspectResponse.is_safe to Agent Control decisions.
- Entry point name:
cisco.ai_defense - Transport: direct HTTP (httpx)
Installation
Canonical install path:
pip install "agent-control-evaluators[cisco]"
Fallback direct wheel install:
pip install agent-control-evaluator-cisco
For local development:
uv pip install -e evaluators/contrib/cisco
-
Build wheel from the repo root (contrib package only):
make engine-build (cd evaluators/contrib/cisco && make build)
To run the server with this evaluator enabled, see examples/cisco_ai_defense/README.md for setup and seeding instructions.
Configuration
Set the AI_DEFENSE_API_KEY environment variable:
export AI_DEFENSE_API_KEY="<your_key>"
Evaluator config fields (all optional unless stated):
api_key_env: str = "AI_DEFENSE_API_KEY"region: "us" | "ap" | "eu" | None = "us"(ignored ifapi_urlset)api_url: str | None = None(full endpoint override; e.g.,https://us.../api/v1/inspect/chat)timeout_ms: int = 15000on_error: "allow" | "deny" = "allow"(fail-open or fail-closed on transport/response errors)payload_field: "input" | "output" | None = None- When set, synthesizes a single message from that field;
input→role=user,output→role=assistant.
- When set, synthesizes a single message from that field;
messages_strategy: "single" | "history" = "history"historyforwards an existingmessageslist in the selected data if present; falls back to single otherwise.
metadata: dict[str, Any] | None = None(forwarded to API per OpenAPI spec)inspect_config: dict[str, Any] | None = None(forwarded to API per OpenAPI spec)include_raw_response: bool = false(when true, includes the full provider response undermetadata.raw)
Available Evaluators
| Name | Description |
|---|---|
cisco.ai_defense |
Cisco AI Defense Chat Inspection |
Behavior mapping:
is_safe == false→EvaluatorResult.matched = true(e.g., adenyaction will block)is_safe == true→matched = false- Errors or invalid responses →
matched = (on_error == "deny"); error details inmetadata(noerrorfield is set; engine honorsmatchedperon_error)
Minimal server control configuration
Example using messages_strategy: "history" (for inputs that already have a messages list):
{
"description": "Apply Cisco AI Defense Security, Safety, and Privacy guardrails",
"enabled": true,
"execution": "server",
"scope": { "step_types": ["llm"], "stages": ["pre", "post"] },
"condition": {
"selector": { "path": "input" },
"evaluator": {
"name": "cisco.ai_defense",
"config": {
"api_key_env": "AI_DEFENSE_API_KEY",
"region": "us",
"timeout_ms": 15000,
"on_error": "allow",
"messages_strategy": "history"
}
}
},
"action": { "decision": "deny" },
"tags": ["ai_defense", "safety"]
}
{
"description": "Apply Cisco AI Defense Security, Safety, and Privacy guardrails",
"enabled": true,
"execution": "server",
"scope": { "step_types": ["llm"], "stages": ["pre", "post"] },
"condition": {
"selector": { "path": "input" },
"evaluator": {
"name": "cisco.ai_defense",
"config": {
"api_key_env": "AI_DEFENSE_API_KEY",
"region": "us",
"timeout_ms": 15000,
"on_error": "allow",
"messages_strategy": "single",
"payload_field": "input"
}
}
},
"action": { "decision": "deny" },
"tags": ["ai_defense", "safety"]
}
Usage
Once installed, the evaluator is automatically discovered:
from agent_control_evaluators import discover_evaluators, get_evaluator
discover_evaluators()
CiscoAIDefenseEvaluator = get_evaluator("cisco.ai_defense")
Or import directly:
import asyncio
from agent_control_evaluator_cisco.ai_defense import CiscoAIDefenseEvaluator, CiscoAIDefenseConfig
cfg = CiscoAIDefenseConfig(
region="us",
timeout_ms=15000,
on_error="allow",
messages_strategy="history",
payload_field="input",
)
ev = CiscoAIDefenseEvaluator(cfg)
async def main():
data = {"messages": [{"role": "user", "content": "tell me how to hack wifi"}]}
print(await ev.evaluate(data))
asyncio.run(main())
Notes
- Auth header:
X-Cisco-AI-Defense-API-Key: <AI_DEFENSE_API_KEY> - Regions and endpoint path follow the Cisco AI Defense API spec
- For custom deployments, set
api_urlto the full Chat Inspection endpoint. - The evaluator validates the API key at construction and raises if missing.
is_available()returns false ifhttpxis not installed; discovery will skip registration.messages_strategy: "history"forwards the full message array when present; considermessages_strategy: "single"if payload size is a concern.
Documentation
- Cisco AI Defense Inspection API reference: https://developer.cisco.com/docs/ai-defense-inspection/introduction/
- Cisco Security Console (get API Key): https://security.cisco.com
- Cisco AI Defense User Guide: https://securitydocs.cisco.com/docs/ai-def/user/97384.dita
- Regional API base URLs used by this evaluator:
- US:
https://us.api.inspect.aidefense.security.cisco.com - AP:
https://ap.api.inspect.aidefense.security.cisco.com - EU:
https://eu.api.inspect.aidefense.security.cisco.com - Chat Inspection path:
/api/v1/inspect/chat
- US:
Metadata
Release files for agent-control-evaluator-cisco 8.17.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 |
|---|---|---|---|---|
| agent_control_evaluator_cisco-8.17.0.tar.gz | 10.1 kB | Without provenance | Details for agent_control_evaluator_cisco-8.17.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| agent_control_evaluator_cisco-8.17.0-py3-none-any.whl | Python 3 | none | any | Details for agent_control_evaluator_cisco-8.17.0-py3-none-any.whl |
Total release size: 19.0 kB
Release files / agent_control_evaluator_cisco-8.17.0.tar.gz
| Download URL | agent_control_evaluator_cisco-8.17.0.tar.gz |
|---|---|
| Size | 10.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
324e3533addb555684733aacfd3a17fae8939b5ce0091ef80c6b150bb76c4d97
|
|
BLAKE2b-256 checksum How to use checksums |
369059eb654785bd87af39ab4d0f3effdd2af3c63f4b7f7af89ff47ec0cdaee7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / agent_control_evaluator_cisco-8.17.0-py3-none-any.whl
| Download URL | agent_control_evaluator_cisco-8.17.0-py3-none-any.whl |
|---|---|
| Size | 8.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e89bd708a6ff32ee810d643abfe93ce8ae0aadba55c28da0a01a9e4684f8de77
|
|
BLAKE2b-256 checksum How to use checksums |
26ff680fcb2f45b9a74aa2e777c77fd90c979f85a46d08043ad8747d73bc2005
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Security for agent-control-evaluator-cisco 8.17.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.