from praisonaiagents import Agent
from praisonaiagents.policy import PolicyEngine, Policy, PolicyRule, PolicyAction
# Create policy engine with rules
engine = PolicyEngine()
engine.add_policy(Policy(
name="no_delete",
rules=[
PolicyRule(
action=PolicyAction.DENY,
resource="tool:delete_*",
reason="Delete operations blocked"
)
]
))
# Agent with policy enforcement
agent = Agent(
name="SecureAgent",
instructions="You are a file management assistant.",
policy=engine
)
# Policy is enforced during agent operations
agent.start("Help me organize and clean up my files")
# Delete operations will be blocked by policy