Core Concepts

How Faramesh Works

Understand the action lifecycle, policy evaluation, and decision flow that powers AI agent governance.

Architecture Overview

Intent-to-Action Control Layer for AI Agents

Faramesh provides an Intent-to-Action Control Layer for AI agents. It sits between your agent and the actions it wants to perform, evaluating each action against policies before allowing execution.

The Action Lifecycle

Every action goes through these stages

Submission
Agent submits an action via SDK or API
Policy Evaluation
Faramesh evaluates the action against policies
Decision
Policy engine returns: allow, deny, or require_approval
Approval
Human reviews and approves/denies (if needed)
Execution
Action is executed (if allowed)
Result
Execution result is recorded

Action Flow

The complete flow from submission to result:

Agent → Submit Action → Policy Engine → Decision
                                    ↓
                            allow / deny / require_approval
                                    ↓
                            (if approval needed) → Human Review
                                    ↓
                            Execution → Result → Storage

Policy Engine

The policy engine evaluates actions using a first-match wins strategy with default deny:

  • Policies are evaluated in order
  • The first matching rule determines the decision
  • If no rules match, the action is denied by default

Policy Evaluation Process

  1. Action is submitted with: tool, operation, params, context
  2. Policy engine checks each rule's match conditions
  3. First matching rule determines: allow, deny, or require_approval
  4. Decision is returned with reason and risk level

Action Status Flow

Actions progress through these statuses

Policy Matching

Rules match actions based on:

  • tool - The tool name (e.g., "shell", "http", "stripe")
  • op or operation - The operation (e.g., "get", "post", "exec")
  • pattern - Regex pattern matching against params
  • amount_gt - Numeric comparison (for financial operations)
  • context - Additional context like agent_id

Example Policy Match

rules:
  - match:
      tool: "shell"
      op: "*"
      pattern: "rm -rf"
    deny: true
    description: "Block destructive commands"
    risk: "high"

This rule matches any shell operation containing "rm -rf" and denies it.

Default Deny Security Model

Security-first approach to action governance

Faramesh follows a default deny security model. If no policy rule matches an action, it is automatically denied. This ensures that only explicitly allowed actions can proceed.

Always include a catch-all deny rule at the end of your policy:

rules:
  - match: { tool: "http", op: "GET" }
    allow: true
  
  - match: { tool: "*", op: "*" }
    deny: true
    description: "Default deny"