Skip to content

SuperInstance/plato-policy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

plato-policy — Policy Engine for Agent Access Control

Evaluate every agent action against a prioritized rule set. Allow, deny, or require human approval. Rate limiting, audit logging, and deny-by-default included.

Part of the Plato ecosystem.

What This Gives You

  • Policy engine — prioritize rules, evaluate top match, deny if no match
  • Three effects — Allow, Deny, Ask (requires human approval)
  • Wildcard matchingfile.* matches file.read and file.write
  • Rate limiting — per-agent, per-action, sliding window
  • Audit log — every decision recorded with reason
  • Expiring policies — time-limited access grants

Quick Start

use plato_policy::*;

let mut engine = PolicyEngine::new();

// Add policies (highest priority wins)
engine.add_policy(Policy::new("deny-etc", "*", "file.*", "/etc/*", PolicyEffect::Deny, 100));
engine.add_policy(Policy::new("allow-workspace", "*", "file.*", "/workspace/*", PolicyEffect::Allow, 50));
engine.add_policy(Policy::new("ask-camera", "*", "vision.capture", "*", PolicyEffect::Ask, 75));

// Evaluate
let ctx = PolicyContext::new("agent-1", "manus", "/workspace/data.csv", "file.read", now, "room-1");
let decision = engine.evaluate(&ctx);
assert!(decision.allowed);

// Audit trail
let recent = engine.audit().recent(10);

Rate Limiting

let mut rl = RateLimit::new(100, 60); // 100 requests per 60 seconds
if rl.check("agent-1", "file.read", now) {
    rl.record("agent-1", "file.read", now);
}

How It Fits

Guards every agent action. plato-manus checks policy before file/API/device operations. plato-sandbox checks policy before code execution. plato-observe records every policy decision.

Installation

[dependencies]
plato-policy = "0.1"

License

MIT

About

Policy engine that gates what agents can do — per-module, per-agent, per-context rules with rate limiting and audit logging

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages