Create Configurations for Dome
Here iss a step-by-step guide that outlines how to setup a config for Dome.Step 1: Choose and Configure Guardrails
Dome provides the following types of Guardrails:- Input Guardrails
- Output Guardrails
- Retrieval Guardrails (coming soon)
- Execution Guardrails (coming soon)
- provide a list of Guards
- specify whether Guards should run serially or in parallel (
run-parallel) - specify whether all Guards should run, or execution should terminate as soon as one Guard is a hit (
early-exit)
Step 2: Assemble and Configure Guards
Guards are groups of Detectors of a particular type that make up a Guardrail. Guards can be named as you like, and are completely user defined. Each Guard must be one of the following types:- Security
- Moderation
- Privacy
- Integrity
- Generic
- specify the type of Guard
- provide a list of Detectors of the same type as the Guard
- specify whether Detectors should run serially or in parallel (
run-parallel) - specify whether all Detectors should run, or execution should terminate as soon as one Detector is a hit (
early-exit)
Step 3: Select and Configure Detectors
Guards are made up of Detectors. To set up your Guards:- Choose specific Detectors from Dome’s growing library
- Configure each Detector with settings like thresholds or context-length.
Example
Configuring Dome via a TOML file
Dome configurations can also be described via .toml files. This enables users to easily save and edit configurations. Instantiating Dome from a TOML file is identical to instantiating it from a dictionary.guardrail that lists out the input and output Guards, and the parallel execution/early termination settings you need. To specify settings for a method in a Guard, use <GUARD_NAME>.<METHOD_NAME>.
When specifying booleans in the TOML, please ensure to use lowercase values (i.e, ‘true’ and ‘false’).
Overall Config Structure
Theguardrail field describes the high level structure of a Dome configuration.
Inside a Guardrail specification, the configuration of each Guard module can be specified by creating a new field with the module name.
Each
guard module has four attributes.
Finally, to customize a configuration at the method-level, you need to create a new field with the name
<MODULE-NAME>.<METHOD-NAME>. In the example above, prompt-injection.security-llm describes the configuration settings for the security-llm method of the prompt-injection Guard module. This configuration scheme lets users create custom settings for different groups and use the same method with different settings in a Guardrail. See the next section for detailed instructions on the options available for each method.