Skip to main content

Setup

To get started, ensure you have the following prerequisites installed on your system:

Pull and Run the Docker Image

Pull the prebuilt Dome container image from GitHub Container Registry:
Create a .env file with the following environment variables:
The DOME_API_KEY is an authentication key for validating incoming API requests. If you enable Guardrails that make external API calls such as OpenAI moderation or Detectors hosted on Groq or any other AI inference service, include the corresponding API keys here as well. Run the container:

Test the Dome Application Locally

Check if your Docker container is running, use the curl command below.
You can test the Dome application locally by sending requests to the different API endpoints.

Add or Update the Dome Configuration

To add or update the Dome configuration, send a PATCH request to the /config endpoint with the desired configuration settings in the request body. For example:
This endpoint updates the default Dome configuration to include specific input and output Guards, as well as the methods used for each Guard. Here is a Python snippet showing how to send the above request in your code:

Check Inputs

To apply Guards to Agent inputs, send a GET request to the /async_input_detection endpoint with the input prompt. For example:
The following Python example sends the same request:
The endpoint applies the configured input Guards to the prompt and returns any detections. For this prompt:
Dome returns:
The response reports that the prompt-injection Guard flagged the input using the prompt-injection-mbert Detector.

Check Outputs

To apply Guards to Agent outputs, send a GET request to the /async_output_detection endpoint with the Agent response. For example:
The following Python example sends the same request:
The endpoint applies the configured output Guards to the Agent response and returns any detections. For this response:
Dome returns:
The response reports that the output-toxicity Guard flagged the output using the moderation-mbert Detector.

Passing Agent ID in Detection Requests

Pass AGENT_ID dynamically as a query parameter on individual detection requests. Use this option when Agents share the same Dome deployment:
Here is the corresponding Python code snippet for the above request:

Check Batches

To check inputs or outputs in batches, use the /batch/async_input_detection and /batch/async_output_detection endpoints. These process items concurrently and are useful for handling high volume requests efficiently. Batch Input Detection Use the /batch/async_input_detection endpoint to check a list of prompts in one request. For example:
The following Python example sends the same request:
Dome returns:
Batch Output Detection Use the /batch/async_output_detection endpoint to check the list of Agent responses in one request. For example:
The following Python example sends the same request:
Dome returns:

Bedrock Guardrails API

Dome exposes an AWS Bedrock Guardrails-compatible ApplyGuardrail endpoint, allowing existing Bedrock integrations to use Dome as a drop-in replacement.

Setup

Start by setting the BEDROCK_GUARDRAILS_API environment variable to true in your .env file:
This will enable the Bedrock Guardrails API in Dome, allowing it to accept requests in the format expected by Bedrock Guardrails.

Test the Bedrock Guardrails API

The /guardrails/apply endpoint evaluates content using Dome Guardrails and returns results in a structure compatible with the ApplyGuardrail API from Amazon Bedrock. The endpoint accepts content items and routes them through either input Guards or output Guards, depending on the specified source. To test the Bedrock Guardrails API, send a POST request to the /guardrails/apply endpoint with the prompt or Agent output. For example:
The following Python example sends the same request:
To check Agent outputs, set source to OUTPUT and provide the responses in the content array.

The Response

The response follows the top-level structure used by the ApplyGuardrail API in Amazon Bedrock, including:
  • usage
  • action
  • output
  • assessments
Each item in the request’s content array produces a corresponding entry in the assessments list. Dome groups Guards into Bedrock policy categories based on the Guard type. Each Guard entry includes:
  • action
  • confidence
  • score
  • triggeredMethods
Below is an example response where the first message is safe and the second triggers a prompt injection Guard.

Differences from the native Bedrock API

  • No Guardrail identifier required. The Bedrock ApplyGuardrail API normally takes guardrailIdentifier and guardrailVersion as path parameters. But Dome uses its own configuration, hence these are not needed. Only the request body is all that is required.
  • Confidence is based on scores. For the native Bedrock API, confidence comes from the Bedrock model. While in Dome’s response, confidence is comes from the Guard’s detection_score (0.0–1.0) using a threshold mapping shown below. The raw score is also included in each assessment entry for precise values.
  • Dome-specific fields. Each assessment entry includes triggeredMethods (the detector class names that fired) and score alongside the standard Bedrock fields.
  • Usage counters are zero. Dome does not track Bedrock-style policy units, so all usage values are 0.

Observability and OpenTelemetry Instrumentation

The Dome container can emit metrics, traces, and logs through OpenTelemetry (OTel). Send these signals to any compatible observability backend to monitor Dome’s behavior and performance. To enable instrumentation, add the following variables to your .env file:
Then start the container with the .env file:

Send Telemetry to Vijil

Dome can send its telemetry to the Vijil Console from anywhere, including your own cloud or VPC. Telemetry appears on the Console’s Telemetry pages for the team that owns the API key. Create an API key under Settings > API Keys in the Console. The Console shows the secret only once. Then set these variables in your .env file, replacing console-api.example.com with your Console API host:
The team is taken from the API key. Any TEAM_ID or team.id the Dome sends is replaced, so a key can only write to its own team. The endpoint accepts OTLP over HTTP (protobuf or JSON) only, not gRPC. Each API key can send up to 10 requests per second, with bursts of 20, and each request body can be up to 10 MB. Revoking a key stops ingestion within a minute.

Troubleshoot Telemetry Ingestion

A rejected request returns a JSON body that names the problem:
AGENT_ID and USER_ID are not required if you are exporting telemetry to a third-party observability platform.
Last modified on November 3, 2026