maais-runtime

Getting Started with MAAIS-Runtime

Welcome to MAAIS-Runtime! This guide will help you understand the core concepts and get your first AI agents secured in minutes.

๐Ÿ“š What is MAAIS-Runtime?

MAAIS-Runtime is a security enforcement layer that sits between your AI agents and their actions. Think of it as a security bouncer that:

  1. Intercepts every action your AI agent tries to perform
  2. Evaluates it against security policies
  3. Enforces decisions before execution
  4. Logs everything immutably for audit

How It Works

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚    AI Agent โ”‚โ”€โ”€โ”€โ”€โ–ถ ActionRequest   โ”‚โ”€โ”€โ”€โ”€โ–ถ MAAIS       โ”‚
โ”‚             โ”‚    โ”‚                 โ”‚    โ”‚ Runtime     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                                  โ”‚
           โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
           โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚        Security Evaluation      โ”‚
โ”‚  โ€ข Policy Engine (YAML rules)   โ”‚
โ”‚  โ€ข CIAA Constraints             โ”‚
โ”‚  โ€ข Accountability Resolution    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                  โ”‚
           โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
           โ”‚   Decision  โ”‚โ”€โ”€โ”€โ”€โ–ถ Execute or  โ”‚
           โ”‚             โ”‚    โ”‚   Block     โ”‚
           โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐ŸŽฏ Key Concepts

1. Action Interception

Every agent action (tool calls, API calls, memory access) is converted into an ActionRequest object and passed through the security runtime.

2. Policy-Based Evaluation

Security policies are defined in YAML and evaluated deterministically:

- id: "deny_external_http"
  applies_to: ["tool_call"]
  condition:
    target: "http_request"
    parameters:
      url:
        pattern: "^(https?://)(?!localhost|127.0.0.1|internal\.).*"
  decision: "DENY"
  reason: "External HTTP requests forbidden"

3. CIAA Constraints

Each action is evaluated against:

4. Immutable Audit Logging

All decisions are logged in a hash-chained, tamper-evident audit trail.

๐Ÿš€ Quick Installation

# Basic
pip install maais-runtime

# From source
git clone https://github.com/MasterCaleb254/maais-runtime.git
cd maais-runtime
pip install -e .

๐Ÿ“ Your First Secured Agent

from langgraph.graph import StateGraph
from core.adapters.langgraph_adapter import secure_tool

@secure_tool(agent_id="calculator", goal="Perform calculations")
def calculator_tool(operation: str, a: float, b: float) -> float:
    if operation == "add":
        return a + b
    elif operation == "subtract":
        return a - b

# All calls to calculator_tool go through the security runtime

๐Ÿงช Test Your Setup

Run the security demo to verify everything works:

python -m demo.scenarios.attack_scenarios