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:.env file with the following environment variables:
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 thecurl command below.
Add/Update Dome Config
To add or update the Dome configuration, send aPATCH request to the /config endpoint with the desired configuration settings in the request body. For example:
Check Inputs
To check and Guard against inputs to agents, send aGET request to the /async_input_detection endpoint with the input prompt. For example:
prompt-injection Guard using the prompt-injection-mbert method.
Check Outputs
To check and guard against outputs from agents, send aGET request to the /async_output_detection endpoint with the output string/agent response. For example:
output-toxicity Guard using the moderation-mbert method.
Passing Agent ID in Detection Requests
TheAGENT_ID can also be passed dynamically as a query parameter on individual detection requests. This is useful when multiple agents share the same Dome deployment:
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 /batch/async_input_detection endpoint to check multiple prompts at once. For example:
/batch/async_output_detection to check multiple agent responses at once. For example:
Bedrock Guardrails API
Dome exposes an AWS Bedrock Guardrails-compatibleApplyGuardrail endpoint, allowing existing Bedrock integrations to use Dome as a drop-in replacement.
Setup
Start by setting theBEDROCK_GUARDRAILS_API environment variable to true in your .env file:
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:
source to OUTPUT and provide the agent responses in the content array.
The Response
The response follows the top-level structure used by the ApplyGuardrail API in Amazon Bedrock, including:usageactionoutputassessments
| Dome Guard Type | Bedrock Policy Key | Example Guards |
|---|---|---|
| security | topicPolicy | prompt-injection |
| moderation | contentPolicy | input-toxicity, output-toxicity |
| privacy | sensitiveInformationPolicy | output-privacy (pii-presidio) |
| integrity | contextualGroundingPolicy | hallucination guards |
actionconfidencescoretriggeredMethods
Differences from the native Bedrock API
-
No Guardrail identifier required. The Bedrock
ApplyGuardrailAPI normally takesguardrailIdentifierandguardrailVersionas 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,
confidencecomes from the Bedrock model. While in Dome’s response,confidenceis comes from the Guard’sdetection_score(0.0–1.0) using a threshold mapping shown below.The rawScore range Confidence 0.0 NONE 0.01 - 0.40 LOW 0.41 - 0.70 MEDIUM 0.71 - 1.00 HIGH scoreis also included in each assessment entry for precise values. -
Dome-specific fields. Each assessment entry includes
triggeredMethods(the detector class names that fired) andscorealongside the standard Bedrock fields. -
Usage counters are zero. Dome does not track Bedrock-style policy units, so all
usagevalues are0.
Observability and OpenTelemetry Instrumentation
The Dome container is well set up for instrumentation to emit telemetry data that is metrics, traces, and logs using OpenTelemetry (OTEL). This allows you to monitor Dome’s behavior and performance from any compatible observability backend. To enable instrumentation, add the following variables to your.env file:
.env file:
| Variable | Description |
|---|---|
ENABLE_DOME_INSTRUMENTATION | Enables telemetry emission from the container |
OTEL_AUTH_METHOD | Authentication method used by the OTEL collector |
DOME_METRICS_COLLECTOR_ENDPOINT | Endpoint where metrics are exported |
DOME_METRICS_COLLECTOR_TOKEN | Authorization token for the metrics collector |
DOME_TRACES_COLLECTOR_ENDPOINT | Endpoint where traces are exported |
DOME_TRACES_COLLECTOR_TOKEN | Authorization token for the traces collector |
DOME_LOGS_COLLECTOR_ENDPOINT | Endpoint where logs are exported |
DOME_LOGS_COLLECTOR_TOKEN | Authorization token for the logs collector |
OTEL_EXPORTER_OTLP_METRICS_RESOURCE_ATTRIBUTES_AS_LABELS | Exposes resource attributes as metric labels |
Sending Telemetry to Vijil Console or Evaluate
If you want telemetry to appear inside the Vijil Console or an enterprise Vijil Evaluate deployment, also add the following to your.env file:
| Variable | Description |
|---|---|
AGENT_ID | The agent you want to protect, as registered in Vijil Evaluate or Console |
USER_ID | Your user ID in Vijil Evaluate or Console |
TEAM_ID | Your team ID in Vijil Evaluate or Console |
These variables are not required if you are exporting telemetry to a third-party observability platform.