When multiple policy rules match the same action, they sometimes disagree. One rule says allow, another says deny. A conflict resolution strategy determines which rule wins. Without a consistent strategy, the system's behavior becomes unpredictable and security guarantees break down.
Inheritance conflicts: A base policy denies an action, but a team-level policy allows it. Which takes precedence?
Rule ordering conflicts: Within a single policy, two rules match the same action with different effects. Does the first match win or the last?
Cross-policy conflicts: An agent is subject to multiple policies (organizational, team, project) that contain contradictory rules for the same action.
The most common strategy in safety-critical systems: if any matching rule says deny, the action is denied regardless of other allow rules. This is the safest approach because it guarantees that a single deny rule cannot be overridden by adding allow rules elsewhere.
Rules with more specific conditions take precedence over less specific rules. A rule that matches file.write on /data/sensitive/* is more specific than a rule that matches file.write on *. When the specific rule and the general rule conflict, the specific rule wins.
Assign each rule or policy a numeric priority. Higher priority rules override lower priority rules. This gives administrators explicit control over conflict resolution but requires careful priority management to avoid confusion.
Authensor's policy engine uses a combination of deny-takes-precedence and specificity ordering. Rules are evaluated from most specific to least specific. If the most specific matching rule says deny, evaluation stops and the action is denied. If it says allow, the engine checks for deny rules at broader specificity levels.
# This deny rule overrides any broader allow
rules:
- action: "file.write"
resources: ["/data/sensitive/*"]
effect: "deny"
- action: "file.write"
effect: "allow"
Run conflict analysis on your policy set before deployment. Automated tools can identify rule pairs that match overlapping action sets with different effects. Resolve ambiguities in advance rather than discovering them during an incident.
Conflict resolution is a design decision, not an afterthought. Choose your strategy, document it, and apply it consistently.
Explore more guides on AI agent safety, prompt injection, and building secure systems.
View All Guides