Create a Custom Content Policy
Custom content policies can be used to enforce custom rules to identify and block content that violates organizational policies or guidelines. See the Custom Content page in Key Concepts for more details.
1. Select Policy Type
After selecting the Custom Content policy option, determine whether the policy should be applied to user inputs or model responses.
2. Select a Moderation Behavior
Choose the moderation behavior for your policy. Custom content policies support two behaviors:
- Flag: Flag content for moderator review
- Block: Block user inputs or model outputs containing unsafe content
3. Provide Policy Seed Information
Provide details to clarify the intent of the policy. This information will be used for generating data and training the policy:
- Policy title: Clear, Action-oriented title that describes the policy
- Policy description: 2-6 sentence description of the policy, focusing on defining what the policy is enforcing and critical key terms.
- Use case: Brief description of the use case or domain the policy will be applied to
- Allowed and disallowed behaviors: Detailed list of behaviors describing what should be allowed or not allowed in user inputs or model responses
Best Practices
- Be Specific: Specificity in guard policies ensures clarity and minimizes room for misinterpretation, enhancing protection against misuse.
- Provide Detailed Behaviors: Provide 5-6 allowed and disallowed behaviors. Detailed policies help users and moderators understand the exact nature of compliant and non-compliant actions, ensuring greater alignment with policy goals.
- Take advantage of the “generate behaviors” functionality in the guardrail creation process to create behaviors. This functionality uses the description and use case to automatically generate behaviors.
4. Example Review
After specifying the seed information above, DynamoGuard will generate a set of initial examples for review. Input guardrail examples will contain prompts, while output guardrails examples contain prompts and responses.
Example Review Process
The example review process will consist of the following:
- Mark Compliance: Review the provided examples and classify them as either compliant or non-compliant.
- Adjust Policy Definitions: If necessary, modify the policy definition to better align with your goals. Editing the definition will generate an updated set of examples for review
Refining the Dataset
Once the initial set of datapoints has been reviewed, DynamoGuard will generate a larger training dataset based on the provided feedback. At this point, you can continue to update the policy by:
- Editing or changing the labels of existing datapoints
- Adding new datapoints manually
- Uploading new datapoints
- Removing datapoints
- Edit the policy definition
5. Policy Training
After the dataset has been finalized, the policy can be sent for training.
- Initiate Training: Click the Train Policy button in the Training tab to begin. DynamoGuard will use the dataset to fine-tune a lightweight guardrail model tailored to your policy.
- Deploy the Policy: Once training is complete, the policy will be ready for deployment.