TypeSafe AI
Typesafe AI provides a platform for structured, explainable AI-powered decision-making using typed questions and contextual state.
Typesafe AI is an advanced AI decision engine designed to evaluate, score, and classify unstructured data using customizable models. This connector enables Swimlane Turbine users to automate complex decision-making processesβsuch as single-choice selection, yes/no probability assessments, and multi-level scoringβdirectly within their security workflows. By integrating Typesafe AI, security teams can leverage AI-driven evaluations to triage incidents, prioritize alerts, and enrich case data without manual intervention. The connector also allows users to retrieve available AI models and flexibly tailor automation to their unique operational needs, enhancing both accuracy and efficiency in security operations.
Limitations
- Text only. No image, audio, or video. Serialize a JSON object or array to a string before binding it as state.
- Rate limits (429) and overload (529) are returned to the action. The definition runner does not retry. A 529 is transient, so add an on-failure retry path when the flow cannot miss a call.
- The ask_* actions always publish the answer under the question id result. Use Evaluate when you need more than one question id.
- model is required. A blank Model field is omitted from the body and the API returns 422. The actions default it to jev-latest.
- Choice criteria is one object with 2 to 255 options. Score criteria is an array of 2 to 10 strings. Bind Noul and Choice criteria as object expressions.
Supported Versions
- This TypeSafe AI connector uses the v1 API (/v1/systemone and /v1/models).
Additional Documents
- Documentation TypeSafe API
- Models and aliases TypeSafe models
Configuration
Prerequisites
To use the Typesafe AI connector, ensure you have the following prerequisites:
- HTTP Bearer authentication to api.typesafe.ai using these parameters:
- URL: The endpoint for the Typesafe AI API (e.g., https://api.typesafe.ai)
- API Key: A valid API key generated from your Typesafe AI dashboard, used for authenticating requests
Authentication Methods
- URL: The endpoint URL for accessing the TypeSafe API. Leave the default unless you are pointed at a private endpoint.
- API Key: A key used to authenticate API requests. Do not log this value.
- Verify SSL Certificates: Verify TLS certificates on outbound requests. Default is true.
- HTTP(s) Proxy: Optional proxy for outbound requests. Leave blank for none.
A 401 means the API key is missing or invalid.
Capabilities
This TypeSafe AI connector provides the following capabilities:
- Evaluate
- Ask Noul
- Ask Choice
- Ask Score
- List Models
Evaluate
- POST /v1/systemone. Evaluate state against a map of typed questions and return answers keyed the same way Click Here.
Ask Noul
- POST /v1/systemone with one noul (yes/no probability) question stored under answers.result Click Here.
Ask Choice
- POST /v1/systemone with one choice question stored under answers.result. criteria is a map of option id to rubric, with 2 to 255 options Click Here.
Ask Score
- POST /v1/systemone with one score question stored under answers.result. criteria is an ordered list of 2 to 10 level descriptions Click Here.
List Models
- GET /v1/models. Returns aliases and models this account may send in the model field Click Here.
Configurations
TypeSafe API Key
Authenticates to api.typesafe.ai with a Bearer API key from the TypeSafe dashboard.
Configuration Parameters
Parameter | Description | Type | Required |
|---|---|---|---|
url | TypeSafe API base URL. Leave the default unless you are pointed at a private endpoint. | string | Required |
token | TypeSafe API key. Sent as Authorization Bearer. Do not log this value. | string | Required |
verify_ssl | Verify TLS certificates on outbound requests. | boolean | Optional |
http_proxy | Optional HTTP(S) proxy for outbound requests. Leave blank for none. | string | Optional |
Actions
Ask Choice
Send a single-choice question to Typesafe AI and receive the selected answer in answers.result. Requires state, model, and questions in the request body.
Endpoint
- URL: v1/systemone
- Method: POST
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
state | string | Optional | Content to evaluate. Plain text, or a JSON string such as a serialized ticket, chat log, or record. |
model | string | Optional | Model id or alias. Default jev-latest. |
questions | object | Optional | Parameter for Ask Choice |
questions.result | object | Required | Result of the operation |
questions.result.type | string | Required | Type of the resource |
questions.result.instructions | string | Required | What the model should decide among the criteria options. |
questions.result.criteria | object | Required | Bind an option-id to rubric object. Use null when an option needs no extra detail. At least 2 options and at most 255. |
Input Example
{"state":"string","model":"jev-latest","questions":{"result":{"type":"choice","instructions":"string","criteria":{}}}}
Output
Parameter | Type | Description |
|---|---|---|
status_code | integer | HTTP status code of the response |
reason | string | Response reason phrase |
model | string | Output field: model |
answers | object | Output field: answers |
answers.result | object | Result of the operation |
answers.result.type | string | Type of the resource |
answers.result.choice | string | Highest-probability option id. |
answers.result.probabilities | object | Every option mapped to its probability. Values sum to 1. |
answers.result.confidence | number | How certain the model is, from 0 to 1. |
usage | object | Output field: usage |
usage.input_tokens | integer | Input data for the action |
usage.output_tokens | integer | Output field: usage.output_tokens |
Output Example
{"model":"string","answers":{"result":{"type":"string","choice":"string","probabilities":{},"confidence":123}},"usage":{"input_tokens":123,"output_tokens":123}}
Ask Noul
Submit a yes/no probability question to Typesafe AI and receive the result under answers.result. Requires state, model, and questions in the request body.
Endpoint
- URL: v1/systemone
- Method: POST
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
state | string | Optional | Content to evaluate. Plain text, or a JSON string such as a serialized ticket, chat log, or record. |
model | string | Optional | Model id or alias. Default jev-latest. |
questions | object | Optional | Parameter for Ask Noul |
questions.result | object | Required | Result of the operation |
questions.result.type | string | Required | Type of the resource |
questions.result.instructions | string | Required | Yes/no question to evaluate. The answer is P(yes) from 0 to 1. |
questions.result.criteria | object | Optional | Optional. Bind an object with keys "true" (what a yes near 1 means) and "false" (what a no near 0 means). |
Input Example
{"state":"string","model":"jev-latest","questions":{"result":{"type":"noul","instructions":"string","criteria":{}}}}
Output
Parameter | Type | Description |
|---|---|---|
status_code | integer | HTTP status code of the response |
reason | string | Response reason phrase |
model | string | Output field: model |
answers | object | Output field: answers |
answers.result | object | Result of the operation |
answers.result.type | string | Type of the resource |
answers.result.noul | number | Probability the answer is yes, from 0 to 1. |
usage | object | Output field: usage |
usage.input_tokens | integer | Input data for the action |
usage.output_tokens | integer | Output field: usage.output_tokens |
Output Example
{"model":"string","answers":{"result":{"type":"string","noul":123}},"usage":{"input_tokens":123,"output_tokens":123}}
Ask Score
Submit a score question to Typesafe AI and receive the result under answers.result by providing state, model, and questions in the request body.
Endpoint
- URL: v1/systemone
- Method: POST
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
state | string | Optional | Content to evaluate. Plain text, or a JSON string such as a serialized ticket, chat log, or record. |
model | string | Optional | Model id or alias. Default jev-latest. |
questions | object | Optional | Parameter for Ask Score |
questions.result | object | Required | Result of the operation |
questions.result.type | string | Required | Type of the resource |
questions.result.instructions | string | Required | What the model should rate along the ordered criteria levels. |
questions.result.criteria | array | Required | Ordered level descriptions, from the low end to the high end. At least 2 levels and at most 10. |
Input Example
{"state":"string","model":"jev-latest","questions":{"result":{"type":"score","instructions":"string","criteria":["string"]}}}
Output
Parameter | Type | Description |
|---|---|---|
status_code | integer | HTTP status code of the response |
reason | string | Response reason phrase |
model | string | Output field: model |
answers | object | Output field: answers |
answers.result | object | Result of the operation |
answers.result.type | string | Type of the resource |
answers.result.score | number | Probability-weighted value across the levels. Can fall between levels. |
answers.result.legend | object | Level index, as a string key, mapped to its description. |
answers.result.probabilities | object | Level index, as a string key, mapped to its probability. Values sum to 1. |
answers.result.confidence | number | How certain the model is, from 0 to 1. |
usage | object | Output field: usage |
usage.input_tokens | integer | Input data for the action |
usage.output_tokens | integer | Output field: usage.output_tokens |
Output Example
{"model":"string","answers":{"result":{"type":"string","score":123,"legend":{},"probabilities":{},"confidence":123}},"usage":{"input_tokens":123,"output_tokens":123}}
Evaluate
Evaluate a given state against a set of typed questions using Typesafe AI and return answers mapped to each question.
Endpoint
- URL: v1/systemone
- Method: POST
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
state | string | Optional | Content to evaluate. Plain text, or a JSON string such as a serialized ticket, chat log, or record. |
model | string | Optional | Model id or alias. jev-latest is the current stable Jev release. See GET /v1/models. |
questions | object | Optional | Bind an object expression. Each value is a noul, choice, or score question with type and instructions. Noul criteria uses "true" and "false". Choice criteria is an option map of 2 to 255 entries. Score criteria is an ordered array of 2 to 10 level descriptions. |
Input Example
{"state":"string","model":"jev-latest","questions":{}}
Output
Parameter | Type | Description |
|---|---|---|
status_code | integer | HTTP status code of the response |
reason | string | Response reason phrase |
model | string | Output field: model |
answers | object | One answer per question id. Noul has noul (0 to 1). Choice has choice, probabilities, and confidence. Score has score, legend, probabilities, and confidence. |
usage | object | Output field: usage |
usage.input_tokens | integer | Input data for the action |
usage.output_tokens | integer | Output field: usage.output_tokens |
Output Example
{"model":"string","answers":{},"usage":{"input_tokens":123,"output_tokens":123}}
List Models
Retrieve a list of model aliases and models accessible to your Typesafe AI account.
Endpoint
- URL: v1/models
- Method: GET
Output
Parameter | Type | Description |
|---|---|---|
status_code | integer | HTTP status code of the response |
reason | string | Response reason phrase |
models | array | One entry per model or alias this account may send in the model field. |
models.name | string | Model id or alias accepted by the model field. |
models.description | string | What the model is for. |
models.release_date | string | When the model or alias was released. |
Output Example
{"models":[{"name":"Example Name","description":"string","release_date":"string"}]}
Response Headers
Header | Description | Example |
|---|---|---|
Content-Type | The media type of the resource | application/json |
Date | The date and time at which the message was originated | Thu, 01 Jan 2024 00:00:00 GMT |