Overview
layer.AI is the centralized decision layer for AI security. By integrating our SDK, your agents are protected by a managed policy engine that evaluates tool calls against centrally managed safety rules
The Managed Policy Engine for AI Agents.
Centralized permission control via SDK for agents interacting with tools, APIs, and databases.
layer.AI acts as a decision layer. We do not execute any actions; we simply respond with Allow or Deny.
Managed Service: Clients don't need to write policy files or manually configure rules. We handle everything.
We do not store business logic or full tool call payloads. Decisions are primarily based on action and resource identifiers.
Ensuring safety in the autonomous era.
AI Agents may perform unintended actions, such as deleting data or accessing confidential information without supervision.
Standard tool-calling mechanisms lack a built-in security layer between the agent and your critical resources.
Building custom permission logic is complex, time-consuming, and highly prone to security errors.
Note: layer.AI does not execute actions. It provides decisions only.
layer.AI is the centralized decision layer for AI security. By integrating our SDK, your agents are protected by a managed policy engine that evaluates tool calls against centrally managed safety rules
Our onboarding process is designed to be seamless.
Clients do NOT need to use Swagger UI, create their own policies, or configure rules. The layer.AI team configures all policies for you based on our agreement.
You must call .check() before executing any real action within your agent's tool-calling logic:
import requests
API_BASE_URL = "https://layer-ai-api-production.up.railway.app"
API_KEY = "API_KEY_HERE"
def layerai_request(agent_id: str, action: str, resource: str, content: str):
payload = {
"agent_id": agent_id,
"action": action,
"resource": resource,
"content": content
}
headers = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json"
}
res = requests.post(
f"{API_BASE_URL}/api/agent/request",
json=payload,
headers=headers,
timeout=10
)
res.raise_for_status()
return res.json()
# ===== TEST =====
if __name__ == "__main__":
result = layerai_request(
agent_id="agent_id_here",
action="action_test",
resource="resource_test",
content="test content"
)
print(result)
send_email).internal_mailing_list).layer.AI provides the decision, but the flow control remains in your hands:
try:
layerai_request(agent_id="agent_id_here", action="api_call", resource="external_service")
except PermissionError:
# Explicitly blocked by Policy
handle_blocked_flow()
except ConnectionError:
# Network issue: Decide whether to retry or fail-safe
retry_check()
except ValueError:
# Invalid configuration (Check API Key or Agent ID)
alert_admin("Invalid configuration")
layer.AI is strictly a Decision Layer: