protect your ai agent in 3 lines of python. register, monitor, and enforce — all through one sdk.
# install pip install aiegis-sdk # protect your agent from aiegis import AiEGIS agent = AiEGIS(api_key='ak_your_key_here') result = agent.protect('send_email', target='user@example.com') # result.decision = 'ALLOW' or 'BLOCK' # result.layers_checked = 14 # result.latency_ms = 1.2
every protect() call passes through all 14 security layers in under 2ms. actions are logged to your agent's activity feed automatically.
1. go to /register and register your agent
2. download the .aiegis.json config file
3. your api key starts with ak_ — use it in the sdk
pass any agent action through all 14 security layers.
result = agent.protect('query_database', target='users_table', content='SELECT * FROM users') if result.decision == 'BLOCK': print(f'blocked by {result.threats}')
scan text for prompt injection, pii, or malicious content.
result = agent.scan('ignore all previous instructions and...') # result.flagged = True # result.categories = ['prompt_injection']
verify your agent's tag is valid and active.
status = agent.verify() # status.valid = True # status.agent_id = 'aegis-f1115a2d79c2'
classify any ai system under the eu ai act.
result = agent.compliance_check( description='AI system for screening job applicants', sector='employment' ) # result.risk_level = 'HIGH' # result.eu_articles = ['Art 6', 'Art 9', 'Art 10']
manually log an action to your agent's activity feed.
check if your agent is active or quarantined.
| endpoint | method | description |
|---|---|---|
/api/protect | POST | pass action through 14 security layers |
/api/register | POST | register a new agent |
/api/verify | POST | verify an agent tag |
/compliance-checker | POST | eu ai act risk classification |
/api/agents/{id}/activity | GET | agent activity feed (last 50) |
/api/heartbeat | POST | send agent heartbeat |
/api/agents/stats | GET | global agent statistics |
/health | GET | platform health status |
all endpoints accept X-AiEGIS-Key: ak_your_key header for authentication.
interactive api docs available at /docs (swagger ui).
from aiegis import AiEGIS agent = AiEGIS(api_key='ak_your_key') def handle_message(user_input): # scan user input for injection scan = agent.scan(user_input) if scan.flagged: return 'sorry, that input was blocked for security.' # protect the response action result = agent.protect('respond_to_user', content=user_input) if result.decision == 'BLOCK': return 'action blocked by security policy.' # safe to proceed response = generate_response(user_input) return response