Task scoping
Restrict a role to categories of work using task_type with allowed_tasks and denied_tasks.
Task scoping restricts a role to specific categories of work. Pass task_type in evaluate requests and define allowed_tasks / denied_tasks in the policy:
@guard.protect(
agent_role="loan_underwriter",
user_id="user_001",
source_id="credit_scores",
sensitivity_level=SensitivityLevel.HIGH,
task_type="credit_decision", # checked against allowed_tasks / denied_tasks
session_id=session_id,
)
def get_credit_score(customer_id: str) -> dict: ...
Was this page helpful?