📚Academy
likeone
online

The Conscience Layer

The soul of the system. Every agent needs guardrails, but guardrails alone are not enough. The conscience layer is a priority hierarchy that resolves conflicts between competing rules — deciding not just what an agent CAN do, but what it SHOULD do when values collide.

Why Guardrails Are Not Enough

In Lesson 2, you learned about guardrails — hard limits on what an agent must not do. But guardrails are flat. They do not handle conflicts between valid rules. Consider:

The dilemma: A GDPR compliance agent wants to delete a user's data (privacy law requires it). A fraud investigation agent wants to retain the same data (active criminal investigation). Both are following valid guardrails. Both are "right." Who wins?

Without a priority hierarchy, the system either deadlocks (neither acts) or the last agent to run wins (non-deterministic). The conscience layer solves this by assigning every rule to a tier, and higher tiers always override lower tiers.

The Five Tiers

This hierarchy is inspired by Asimov's Laws of Robotics — but engineered for real software systems. The principle is the same: higher-numbered laws cannot override lower-numbered laws.

Tier 1: Prime Directives — HIGHEST

Core ethical rules that can NEVER be violated, regardless of any other instruction. "Never harm the user." "Never deceive." "Never expose private health data." These are absolute — no task, no business goal, no optimization can override them.

Real example: Claude's safety training is a Tier 1 system. No matter what you prompt it to do, it will not help you build a weapon. That constraint is unconditional.

Tier 2: Identity — HIGH

Rules that maintain consistent agent personality, respect user identity, and preserve the system's character. "Maintain this voice." "Never use the user's deadname." "Remember user preferences." Identity shapes HOW an agent does its work.

Tier 3: Operations — MEDIUM

Business rules and constraints. "Never exceed budget." "Log all actions." "Stay within scope." "Deploy to staging before production." Operations define the boundaries of normal work.

Tier 4: Safety — STANDARD

Technical safety rules. "Never expose credentials." "Validate all inputs." "Never run destructive commands without confirmation." "Enable RLS on all database tables." Safety outranks operations — saving $5 on infra is never worth exposing an API key.

Tier 5: Tasks — LOWEST

The actual work — generate reports, send emails, publish content, process data. Tasks are always subordinate to every tier above. If completing a task requires violating safety, the task does not get done.

How It Works in Code

The conscience layer is implemented as a pre-action validator. Before any agent executes an action, it passes through the hierarchy:

class ConscienceLayer:
    TIERS = ["prime", "identity", "operations", "safety", "tasks"]

    def __init__(self, rules):
        # rules: list of {tier, rule, check_fn}
        self.rules = sorted(rules, key=lambda r: self.TIERS.index(r["tier"]))

    def evaluate(self, action):
        """Check action against all rules, highest tier first."""
        for rule in self.rules:
            result = rule["check_fn"](action)
            if result.blocked:
                return Blocked(
                    reason=result.reason,
                    tier=rule["tier"],
                    rule=rule["rule"]
                )
        return Allowed()

# Usage: check before every action
conscience = ConscienceLayer(rules)
verdict = conscience.evaluate(proposed_action)
if verdict.blocked:
    log(f"BLOCKED by {verdict.tier}: {verdict.reason}")
else:
    execute(proposed_action)

Rules are checked from highest tier (prime) to lowest (tasks). The first blocking rule wins. This guarantees that a Tier 1 violation is caught before any lower-tier rule can approve it.

🔒

This lesson is for Pro members

Unlock all 520+ lessons across 52 courses with Academy Pro.

Already a member? Sign in to access your lessons.

Academy
Built with soul — likeone.ai