faramesh.devBETA
docsgithubcommunityget started →

docs

Getting Started

Core

FPL

Governance

Operations

Reference

github ↗slack ↗community ↗

03 , policy

Writing rules in FPL.

FPL (Faramesh Policy Language) is the standard way to write Faramesh policies. It's purpose-built for AI agent governance , shorter than YAML, safer than Rego, and readable by anyone. Rules run top to bottom , first match wins. If nothing matches, default applies.

You can also write policies in plain English (compiled to FPL) or YAML. All three compile to the same internal engine.

See the same policy in each format

policy.fplfpl
agent my-agent {
  default permit

  rules {
    deny! shell/run
      when cmd matches "rm -rf|DROP TABLE"
      reason: "destructive command blocked"

    defer stripe/refund
      when amount > 500
      notify: "finance-team"

    permit stripe/*
      when amount <= 500
  }
}

Good first rules (FPL)

Save these as policy.fpl and use them as your starting point.

policy.fplfpl
agent my-agent {
  default deny

  rules {
    # Block destructive shell commands — permanently, no override
    deny! shell/run
      when cmd matches "rm -rf|DROP TABLE|terraform destroy"
      reason: "destructive command blocked"

    # Hold large payments for human review
    defer payment/transfer
      when amount > 1000
      notify: "finance-team"

    # Allow small payments automatically
    permit payment/transfer
      when amount <= 1000
  }
}

Policy commands

Commands for working with policy files.

Validate

Check for syntax errors before applying.

bash
faramesh policy validate policy.fpl

Test a single call

Dry-run a specific tool call against the policy without starting the daemon.

bash
faramesh policy test policy.fpl \
  --tool payment/transfer \
  --args '{"amount":1200}'

Inspect policy summary

Print a summary of all rules in the file.

bash
faramesh policy inspect policy.fpl

Diff two policy files

See what changed between two versions before deploying.

bash
faramesh policy diff old.fpl new.fpl

Need help? Use any of these support options.

open an issuejoin slackcommunity/forum
MIT License
docsgithubcommunityget started →