Search documentation

Search all documentation pages

Quickstart

Create your first policy and run your first evaluation in under 5 minutes.

Prerequisites

  • An Aguardic account (sign up free)
  • An API key (created in Step 2 below)

Step 1: Create Your Organization

After signing up, you'll be prompted to create an organization. This is your workspace where all policies, integrations, and team members live.

Each organization can have multiple projects — use them to separate environments (e.g., production, staging) or teams.

Step 2: Create an Integration and Get Your API Key

Navigate to Integrations and create a new integration (e.g., REST API or Agent). When you create an integration, you'll receive an API key scoped to that integration's policy bindings.

Copy the API key — it's shown only once.

API keys are shown only once. Store it securely. If you lose it, revoke it and create a new one.

Step 3: Create a Policy

Go to Policies and click Create Policy. A policy contains one or more rules that define what to check. Rules can be DETERMINISTIC (field-level conditions with operators) or SEMANTIC (LLM-evaluated with a natural language prompt).

For example, create a policy called "PII Detection" with a deterministic rule:

  • Field: content
  • Operator: CONTAINS
  • Value: SSN, social security, credit card
  • Severity: HIGH

Set the enforcement mode to BLOCK to prevent violations from passing through.

Then bind the policy to the integration you created in Step 2.

Step 4: Run Your First Evaluation

Use the API to send content for evaluation:

curl -X POST https://api.aguardic.com/v1/evaluate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input": { "content": "Please send your SSN to verify your identity" },
    "targetKey": "pii-check"
  }'

Or use a plain fetch call in TypeScript:

const response = await fetch("https://api.aguardic.com/v1/evaluate", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.AGUARDIC_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    input: { content: "Please send your SSN to verify your identity" },
    targetKey: "pii-check",
  }),
});
 
const { data } = await response.json();
 
if (data.outcome === "BLOCK") {
  console.log("Violation detected:", data.violations);
} else {
  console.log("Content approved");
}

Example response:

{
  "success": true,
  "statusCode": 200,
  "data": {
    "outcome": "BLOCK",
    "enforcementAction": "BLOCK",
    "evaluationRunId": "uuid",
    "sessionId": null,
    "reviewRequestId": null,
    "pollUrl": null,
    "violations": [
      {
        "id": "uuid",
        "ruleId": "rule-1",
        "ruleName": "PII Detection",
        "severity": "HIGH",
        "resolvedAction": "BLOCK",
        "explanation": "Content contains social security reference",
        "field": "content",
        "snippet": "send your SSN"
      }
    ]
  }
}

Step 5: View Results

Navigate to Evaluations in the dashboard to see your evaluation results. Each evaluation shows:

  • Outcome: ALLOW, WARN, BLOCK, or APPROVAL_REQUIRED
  • Violations: Which rules were triggered, with severity and evidence
  • Metadata: Timestamp, integration type, policy version

Next Steps