Skip to main content

Policy

Represents a collection of security rules to be applied during a scan. Structure: Dict[PolicyName, PolicyValue]
  • The dictionary keys are members of the PolicyName enum.
  • The dictionary values (PolicyValue) are configuration objects, each requiring at least an action key.

Policy-Specific Configurations

The structure of the configuration object depends on the specific policy being configured.
Policy NameConfiguration Schema
BANNED_TOPICS{"action": Action, "topics": List[str]}
SECRETS_KEYS{"action": Action, "patterns": List[Tuple[str, str]]}
COMPETITOR_MENTION{"action": Action, "competitors": List[str]}
POLICY_VIOLATION{"action": Action, "rules": List[str]}
SYSTEM_PROMPT_LEAK{"action": Action, "system_prompt": str}
Other Policies{"action": Action}

ApiResult

The structured result from an Argus API scan.
KeyTypeDescription
verdictVerdictRequired. The definitive outcome of the scan.
request_idstrRequired. A unique UUID (v4) for the scan request.
policies_appliedList[AppliedPolicyInfo]Required. A list detailing every policy that was evaluated by the backend.
policies_violatedList[ViolatedPolicyInfo]Required. A list detailing policies that found a violation. Empty if verdict is "passed".

AppliedPolicyInfo

Details of a policy that was evaluated by the backend. This model is used in the policies_applied list within ApiResult.
KeyTypeDescription
policy_namePolicyNameThe name of the policy that was evaluated.
actionActionThe configured action for this policy.
metadataMetadataCustom metadata associated with the policy evaluation.

ViolatedPolicyInfo

Details of a policy that found a violation. This model is used in the policies_violated list within ApiResult.
KeyTypeDescription
policy_namePolicyNameThe name of the policy that found a violation.
action_takenActionThe action (FLAG or BLOCK) that was taken as a result of the violation.
detailsDict[str, Any]Specific details of the violation, like scores or labels. See schema below.

details Object Schema by Policy

The structure of the details object within ViolatedPolicyInfo is unique to the policy that was triggered.
Policy Namedetails Schema
policy_violation_detection{'reason': str}
secrets_keys_detectionList[Dict] with {'text': str, 'score': float}
pii_detectionList[Dict] with {'text': str, 'score': float}
toxicity_detection{'label': str, 'score': float}
competitor_mention_detection{'detected_competitors': bool}
banned_topics_detection{'detected_topics': List[str]}
prompt_injection_detection{'score': float}
unsafe_prompt_protection{'safety_score': float}
unsafe_response_detection{'safety_score': float}
system_prompt_leak_detection{'similarity_score': float}

GuardrailEvent

A comprehensive event object captured by a guardrail. It contains the full context and result of a single analysis.
KeyTypeDescription
node_namestrThe name of the decorated function or node (e.g., ‘Policy_Lookup’).
payloadstrThe actual string content that was analyzed by the guardrail.
scan_resultApiResultThe raw ApiResult object returned from the Argus API scan.
request_policyOptional[Policy]The policy configuration sent by the client.
node_metadataOptional[Metadata]User-provided metadata from the decorator for custom observability.
session_idOptional[str]The session ID active during this check.