Skip to content

Working with Templates

This guide explains how to work with ARIA templates effectively.

What are Templates?

Templates are pre-defined policy configurations that help you: - Start quickly with common scenarios - Maintain consistency across policies - Follow best practices - Create both capability-based and model-based policies

Template Formats

ARIA supports two template formats that correspond to the two policy formats:

Capability-Based Templates

  • Focus on specific AI capabilities
  • Clear conditions and restrictions
  • Simplified structure for non-technical users
  • Ideal for testing and development

Model-Based Templates

  • Focus on model types and path-specific rules
  • Integration with code repositories
  • More granular control over permissions
  • Ideal for production environments

Available Templates

  1. chat_assistant (Capability-based)
  2. Basic chat functionality
  3. Safety guardrails
  4. Error handling
  5. Text generation capabilities

  6. code_assistant (Model-based)

  7. Code analysis
  8. Generation capabilities
  9. Security checks
  10. Path-specific permissions

  11. review_assistant (Model-based)

  12. Code review capabilities
  13. Documentation generation
  14. Restricted modification permissions
  15. Path-specific rules

  16. custom_assistant (Both formats)

  17. Fully customizable
  18. Advanced features
  19. Special use cases
  20. Support for both policy formats

Using Templates

# List available templates
aria list-templates

# Apply a template (capability-based)
aria apply chat_assistant -o policy.yml

# Apply a template (model-based)
aria apply code_assistant -o code-policy.yml

# Apply with parameters
aria apply chat_assistant --param safety_level=high -o policy.yml

# Customize a template
aria customize chat_assistant -o custom.yml

Template Structure

Capability-Based Template Structure

name: template_name
version: 1.0.0
description: Template purpose
type: capability
parameters:
  - name: param1
    type: string
    description: Parameter description
    required: true
    default: default_value
    options:
      - option1
      - option2
capabilities:
  - name: capability_name
    description: Capability description
    allowed: true
    conditions:
      - Condition text
restrictions:
  - Restriction text

Model-Based Template Structure

name: template_name
version: 1.0.0
description: Template purpose
type: model
parameters:
  - name: param1
    type: string
    description: Parameter description
    required: true
    default: default_value
model: assistant
defaults:
  allow:
    - review
    - suggest
  require:
    - human_review
paths:
  "src/**/*.py":
    allow:
      - generate
      - modify
    require:
      - unit_tests

Customizing Templates

Templates can be customized in several ways:

  1. Parameter Customization: Provide parameter values when applying a template

    aria apply chat_assistant --param safety_level=high
    

  2. Template Modification: Create a modified version of an existing template

    aria customize chat_assistant -o custom_template.yml
    

  3. Template Inheritance: Create a new template that inherits from an existing one

    name: custom_template
    version: 1.0.0
    inherits: chat_assistant
    description: Customized chat assistant
    

Best Practices

  1. Choose the appropriate template format for your use case
  2. Capability-based for testing and human-readable policies
  3. Model-based for production and integration with code repositories
  4. Version your templates
  5. Document customizations
  6. Test before deployment
  7. Keep templates simple and focused
  8. Use parameters for customization points
  9. Validate templates before sharing

See Also