SDK reference
Handle failures without opening the boundary.
Typed errors
from agent_security import (
ApprovalRequired,
SecurityDenied,
ConfigurationError,
AgentSecurityTransportError,
)
try:
agent.invoke(request)
except SecurityDenied as error:
log_block(error.reason_code)
except ApprovalRequired as error:
queue_review(error.approval_id)Error classes
- SecurityDenied: policy blocked the operation.
- ApprovalRequired: exact operation awaits review.
- ConfigurationError: invalid URL, key or settings.
- PermissionConfigurationError: permissions do not match discovered tools.
- AgentSecurityHTTPError: service error after retry.
- AgentSecurityTransportError: service unreachable after retry.