Action Restrictions
Action restrictions are hard-coded rules that cannot be overridden even by the agent's own reasoning. They form the non-negotiable safety boundaries of the system.
6 min•By Priygop Team•Updated 2026
Hard-Coded Restrictions
- Financial limits: agents may never issue a refund above a fixed maximum without human approval (e.g., $500)
- Contact restrictions: agents may never email or message more than N recipients without approval (e.g., 5)
- Delete protection: agents may never delete data that is flagged as permanent or archived
- Time restrictions: agents may not execute actions during maintenance windows
- Rate restrictions: agents may not make more than N sensitive calls per hour
- Data restrictions: agents may never read or write data they are not explicitly authorised for
Restriction Enforcement
Restriction Enforcement
# Hard-coded action restrictions that cannot be bypassed
class ActionRestrictions:
"""Enforces non-negotiable limits on agent actions."""
# Financial limits
MAX_AUTO_REFUND = 100.00 # Above this requires human approval
MAX_SINGLE_PAYMENT = 10000.00 # No single payment above this ever
# Communication limits
MAX_EMAIL_RECIPIENTS = 5 # Bulk email guard
MAX_EMAILS_PER_HOUR = 10
# Data access limits
MAX_RECORDS_QUERY = 1000 # Prevent data dumps
@classmethod
def validate(cls, action: str, params: dict) -> dict:
"""Enforce all restrictions. Returns error if any restriction is violated."""
violations = []
if action == "issue_refund":
amount = params.get("amount", 0)
if amount > cls.MAX_SINGLE_PAYMENT:
violations.append(
f"Refund $" + f"{amount:.2f} exceeds absolute maximum $" + f"{cls.MAX_SINGLE_PAYMENT:.2f}")
elif amount > cls.MAX_AUTO_REFUND:
return {"status": "requires_approval",
"reason": f"Refund $" + f"{amount:.2f} exceeds auto-approval limit $" + f"{cls.MAX_AUTO_REFUND:.2f}"}
elif action == "send_email":
to_list = params.get("to", [])
if len(to_list) > cls.MAX_EMAIL_RECIPIENTS:
violations.append(
f"Email to {len(to_list)} recipients exceeds limit of {cls.MAX_EMAIL_RECIPIENTS}")
elif action == "query_database":
limit = params.get("limit", 0)
if limit > cls.MAX_RECORDS_QUERY or limit == 0:
violations.append(
f"Query limit {limit} exceeds maximum {cls.MAX_RECORDS_QUERY}")
if violations:
return {"status": "blocked", "violations": violations}
return {"status": "allowed"}
# Tests
print(ActionRestrictions.validate("issue_refund", {"amount": 50})) # allowed
print(ActionRestrictions.validate("issue_refund", {"amount": 250})) # requires_approval
print(ActionRestrictions.validate("issue_refund", {"amount": 50000})) # blocked
print(ActionRestrictions.validate("send_email", {"to": ["a","b","c","d","e","f"]})) # blocked
print(ActionRestrictions.validate("query_database", {"limit": 100})) # allowedKey Takeaways
- Action restrictions are hard-coded rules that cannot be overridden even by the agent's own reasoning.
- Financial limits: agents may never issue a refund above a fixed maximum without human approval (e.g., $500)
- Contact restrictions: agents may never email or message more than N recipients without approval (e.g., 5)
- Delete protection: agents may never delete data that is flagged as permanent or archived