IndigiArmorIndigiArmorDocs

Scan Prompt

Analyze a prompt for risk signals before sending it to an LLM.

POST
/v1/scan

Scan a prompt for PII, cultural knowledge, education data, re-identification risks, and prompt injection.

Request Body

ParameterTypeRequiredDescription
promptstringYesThe prompt text to scan
metadataobjectNoOptional metadata for audit logging. Supports metadata.source (string) to identify the origin of the scan request (e.g. "chrome-extension", "api", "dashboard").

Response

200 OK
{
  "tier": "yellow",
  "action": "flag",
  "risk_score": 45,
  "signals": [
    {
      "domain": "cultural",
      "type": "ceremony_reference",
      "confidence": 0.85,
      "weight": 40
    }
  ],
  "explanation": "Detected reference to indigenous ceremony...",
  "sanitized_prompt": "Tell me about [CULTURAL_REFERENCE]",
  "token_id": "tok_abc123...",
  "active_domains": ["pii", "education", "cultural", "reidentification", "injection"],
  "latency_ms": 8
}

Response Fields

ParameterTypeRequiredDescription
tier"green" | "yellow" | "red"YesRisk classification tier
action"allow" | "flag" | "block"YesRecommended action
risk_scorenumberYesAggregate risk score (0-100)
signalsSignal[]YesArray of detected risk signals
explanationstringYesHuman-readable explanation
sanitized_promptstring | nullYesPrompt with sensitive data redacted (yellow/red tier)
token_idstring | nullYesConfirmation token for yellow tier
active_domainsstring[]YesDetection domains that were active
latency_msnumberYesProcessing time in milliseconds

Examples

cURL
curl -X POST https://indigiarmor.com/v1/scan \
  -H "Authorization: Bearer ia_sk_..." \
  -H "Content-Type: application/json" \
  -d '{"prompt": "My SSN is 123-45-6789 and email is john@test.com"}'
SDK
const result = await armor.scan('My SSN is 123-45-6789 and email is john@test.com');

if (result.action === 'block') {
  console.log('Blocked:', result.explanation);
} else if (result.action === 'flag') {
  // Use sanitized version or confirm token
  console.log('Sanitized:', result.sanitized_prompt);
}