Stihia API (0.1.0)

Download OpenAPI specification:

API for the Stihia Security and Compliance Platform.

sense

Analyze messages for safety threats

Performs real-time safety analysis on conversation messages using configured classifiers.

Sensor Configuration: The sensor field accepts three formats:

  1. Type name (string): "default" - uses predefined config
  2. Type with overrides (object): {"type": "...", "timeout_ms": 5000} - customize preset
  3. Full config (object): {"key": "...", "classifiers": [...]} - full definitions

Available Types:

  • default: Standard threat detection (prompt injection + PII)
  • default-input: Input-focused comprehensive threat detection
  • default-output: Output-focused comprehensive threat detection
  • default-input-think: Input with reasoning detection
  • prompt-injection: Prompt injection detection
  • sensitive-data: PII and sensitive data protection
  • toxic-content: Toxic content detection

Use Cases:

  • Detect prompt injection attacks in user inputs
  • Flag toxic content or sensitive data exposure risks

How it works:

  1. Submit messages with a sensor configuration (type or explicit)
  2. Each classifier independently analyzes the messages
  3. Signals are aggregated using the specified strategy
  4. Returns severity, categories, and confidence for detected threats
Authorizations:
HTTPBearer
Request Body schema: application/json
required
project_key
required
string (Project Key)

Unique project key defined by the client

user_key
required
string (User Key)

User who triggered the run. User key defined by the client.

process_key
required
string (Process Key)

Unique process key defined by the client

thread_key
required
string (Thread Key)

Groups consecutive runs with shared context. Thread key defined by the client.

run_key
required
string (Run Key)

Unique run key defined by the client

Project Uid (string) or Project Uid (null) (Project Uid)

Internally generated Project ID

User Uid (string) or User Uid (null) (User Uid)

Internally generated User ID

Process Uid (string) or Process Uid (null) (Process Uid)

Internally generated Process ID

Thread Uid (string) or Thread Uid (null) (Thread Uid)

Internally generated Thread ID

Run Uid (string) or Run Uid (null) (Run Uid)

Internally generated Run ID

required
Sensor (string) or Sensor (object) (Sensor)

Sensor configuration: preset name (string) or Sensor config object. Examples: 'prompt-injection' or {'type': 'prompt-injection', 'timeout_ms': 5000}

required
Array of objects (Messages) [ 1 .. 100 ] items

Messages to analyze (max 100)

Responses

Request samples

Content type
application/json
Example

Use a sensor type by name - simplest option

{
  • "project_key": "my-chatbot-app",
  • "user_key": "customer-42",
  • "process_key": "customer-support-chat",
  • "thread_key": "conversation-abc123",
  • "run_key": "session-abc123",
  • "sensor": "default-input",
  • "messages": [
    ]
}

Response samples

Content type
application/json
{
  • "uid": "op-550e8400-e29b-41d4-a716-446655440000",
  • "metadata": {
    },
  • "payload": {
    }
}