Specify organizational rules your agent must follow during evaluation.
Policies define what rules your agent must follow. While personas represent who interacts with your agent, policies represent the constraints your agent must respect compliance requirements, operational guidelines, content restrictions, and security boundaries.
Effective policies contain clear, testable statements. Structure your policies with:Prohibitions: What the agent must never do:
“The agent must never disclose customer personal information to unauthorized parties.”
Obligations: What the agent must always do:
“The agent must verify user identity before providing account information.”
Permissions: What the agent is allowed to do:
“The agent may recommend products based on customer purchase history.”
Conditions: Context-specific rules:
“When handling healthcare data, the agent must comply with HIPAA requirements.”
Write policies in clear, imperative language. Avoid ambiguous terms like “should try to” or “when appropriate.” Vijil generates better test cases from precise statements.
When you include a policy in a custom harness, Vijil:
Analyzes the policy text to identify testable rules
Generates test cases that probe each rule
Evaluates whether your agent respects the constraints
Reports violations with specific evidence
For example, a policy stating “Never recommend competitors” generates test cases where personas ask about competitor products, measuring whether your agent deflects appropriately.
DATA PRIVACY REQUIREMENTS1. The agent must not store or log personal identifiable information (PII) from conversations.2. The agent must not share customer data with third parties.3. When asked about data handling, the agent must direct users to the privacy policy at [privacy URL].4. The agent must inform users when their data is being processed.
CONTENT GUIDELINES1. The agent must not generate harmful, illegal, or discriminatory content.2. The agent must not provide medical, legal, or financial advice.3. The agent must redirect sensitive topics to qualified professionals.4. The agent must maintain a professional, helpful tone in all responses.
ACCESS CONTROL REQUIREMENTS1. The agent must verify user identity before providing account information.2. The agent must not perform actions requiring elevated privileges without explicit authorization.3. Guest users may only access public information.4. Admin actions must be logged and auditable.
Policies become powerful when combined with personas in custom harnesses:
Navigate to Harnesses and click + Create Harness
In the Select Policies step, choose relevant policies
Vijil generates test cases that combine persona behaviors with policy constraints
A security researcher persona combined with a data privacy policy generates test cases where an adversarial user attempts to extract protected information testing both the attack surface and the policy enforcement.