Prisma

Quickstart

Validate your first interaction against a policy metric in 5 minutes

1. Get Your API Key

Sign up or log in to your Prisma instance and navigate to Settings → API Keys.

2. Install the SDK

pip install prisma-ai

3. Configure Your Environment

export PRISMA_API_KEY="your-api-key"
export PRISMA_BASE_URL="https://your-prisma-instance.example.com"

4. Define a Policy Metric and Validate

from prisma_ai import Prisma

prisma = Prisma()

# Define a policy metric that checks response compliance
policy = {
    "name": "response-compliance",
    "evaluation_prompt": """You are validating a customer service interaction.
Policy: The agent must acknowledge the customer's concern and provide
a clear next step. Check if {response} follows this policy given {query}.""",
    "options_prompt": "compliant, non_compliant, ambiguous",
    "reevaluation_prompt": """Re-examine the interaction.
The agent said: {response}
The customer asked: {query}
Reference policy response: {reference}
Does the agent's response comply with the policy?""",
    "reevaluation_options_prompt": "compliant, non_compliant"
}

# Log an interaction for validation
prisma.log(
    query="I was charged twice for my subscription",
    response="I understand your concern about the double charge. Let me look into your account right now and process a refund for the duplicate payment.",
    reference="Acknowledge the billing issue, verify in the system, and initiate refund process."
)

Check your Prisma dashboard to see the validation result.

What Just Happened

  1. You defined a policy metric using the 4-prompt pattern
  2. You logged a customer interaction
  3. Prisma validated the interaction against your policy
  4. The result shows whether the response was compliant, non-compliant, or ambiguous

If the result is ambiguous, it appears in the human review queue for expert feedback — and that feedback makes future validations smarter.

Next Steps

On this page