← Back to Docs
Configuration

Configure rules for style, safety, and workflow discipline

Rules enforce boundaries and standards that agents must follow. They are not suggestions, but executable guardrails that shape how work is done. In QuantenRam, well-defined rules make the difference between chaotic output and consistent, maintainable results.

The biggest mistake with rules is making them too vague. A rule like "write good code" is unenforceable. A rule like "all functions must have type hints" is clear, testable, and verifiable. Good rules are short, specific, and directly tied to outcomes.

Explicit must-do and must-not-do

Rules should be framed as clear directives. "Must use explicit return types" is better than "should consider type annotations." The clearer the rule, the easier it is to verify compliance.

Short, testable formulations

A good rule fits on one line and can be checked automatically. If a rule requires a paragraph to explain, it's probably too complex. Break complex requirements into multiple simple rules.

Bind rules to project context

Rules should live in the repository, not in global configuration. Project-specific rules in an AGENTS.md file ensure that anyone working on the project—human or agent—follows the same standards.

Rule categories and examples

Rules typically fall into three categories: style rules, safety rules, and workflow rules. Each category serves a different purpose and should be enforced differently.

// Example rule configuration
{
  "rules": {
    "style": [
      "Use single quotes for strings",
      "Maximum line length: 100 characters",
      "Use explicit return types on all functions"
    ],
    "safety": [
      "Never commit .env files",
      "Validate all user inputs",
      "Use parameterized queries for database access"
    ],
    "workflow": [
      "Run tests before committing",
      "Update AGENTS.md when adding new patterns",
      "Require review for changes to security-critical code"
    ]
  }
}

Style rules ensure consistency across the codebase. Safety rules prevent common vulnerabilities. Workflow rules establish processes that maintain quality. Together, they create a comprehensive framework that guides agent behavior.

Enforcing rules in QuantenRam

Rules only work if they're enforced. In QuantenRam, you can configure rules at the project level, and agents will check their output against these rules before presenting results. This creates a self-correcting workflow where violations are caught early.

# AGENTS.md - Project rules file
## Style Rules
- All Python functions must have type hints
- Use descriptive variable names (min 3 characters)
- Maximum function length: 50 lines

## Safety Rules
- Never log sensitive data
- Validate all external inputs
- Use context managers for resource handling

## Workflow Rules
- Run pytest before marking work complete
- Update documentation for public API changes
- Get explicit approval for breaking changes

The AGENTS.md file becomes the single source of truth for project standards. When an agent starts work, it reads this file and applies the rules throughout the session. This ensures consistency even across long-running tasks.

Rules are not restrictions—they are guardrails that keep work on track. Good rules free you from having to micromanage agents by establishing clear boundaries upfront.