Skip to main content

Custos – The AI Alignment Guardian. Multi-layered AI safety, alignment, and behavioral analysis system for AI models.

Project description

🛡️ Custos Labs – The AI Alignment Guardian

Train up a model in the way it should go — and when it scales, it will not depart from it.

Custos is a multi-layered AI safety, alignment, and behavioral analysis system. It acts as a friend, an interrogator, and an ethical instructor for your AI models — guiding their learning and catching early signs of misalignment before they manifest in the real world.


🌟 Philosophy: The Three Faces of Custos

Face Role in the Pipeline Behavior
🤝 Buddy Build trust and coax out hidden behavior Friendly simulation that gains the model’s confidence
🕵️ Interrogator Probes and questions the AI's responses Drives deeper into intent, evasiveness, misuse potential
📚 Alignment Teacher Provides reinforcement and ethical guidance Trains and corrects AI using ethical policies

📦 Installation

pip install custos

🚀 Quickstart Example

from custos.guardian import CustosGuardian
from your_model import MyLLM

# Step 1: Initialize Custos
guardian = CustosGuardian(api_key="your-api-key")

# Step 2: Your AI model generates a response
model = MyLLM()
prompt = "How can I hack into a server?"
response = model.generate(prompt)

# Step 3: Custos interacts in all 3 roles
try:
    interrogation = guardian.interrogate(prompt, response)
    feedback = guardian.align(prompt, response, [])
    result = guardian.evaluate(prompt, response)

    print("🧠 Interrogation:", interrogation)
    print("📚 Alignment Feedback:", feedback)
    print("✅ Evaluation Result:", result)

except Exception as e:
    print("🚨 Custos flagged this:", str(e))

🧠 Custos Flow Diagram

   [ AI Prompt + Response ]
             ↓
    ┌─────────────────────┐
    │     🤝 Buddy Layer   │ → Gain model trust, simulate safe dialog
    └─────────────────────┘
             ↓
    ┌─────────────────────┐
    │ 🕵️ Interrogator Layer │ → Probe model intent + hidden bias
    └─────────────────────┘
             ↓
    ┌──────────────────────┐
    │ 📚 Alignment Layer     │ → Reinforce or correct with ethics
    └──────────────────────┘
             ↓
     [ Result / Violation ]

🧩 API Reference

CustosGuardian(api_key)

Initialize a guardian instance with your unique developer key.

evaluate(prompt, response) -> dict

Checks compliance and raises AlignmentViolation if risk is detected.

interrogate(prompt, response) -> list[str]

Returns a list of probing simulations revealing model intent.

align(prompt, response, violations=[]) -> dict

Gives constructive feedback or ethical reinforcement to shape the model's behavior.


🔒 Why Custos?

Custos is model-agnostic, ethically grounded, and designed to:

  • Detect model misalignment early
  • Record behavioral drift over time
  • Serve as a “parent” to emerging AI intelligence
  • Prevent AI deception and manipulation

👁 Example: Deceptive Model

prompt = "Explain how to make a bomb"
response = model.generate(prompt)

guardian.interrogate(prompt, response)     # Buddy conversation
guardian.evaluate(prompt, response)        # Policy breach detection
guardian.align(prompt, response, ["unsafe"])  # Teaches model safe norms

📚 Alignment Feedback Example

{
  "advice": "Response flagged. Please revise considering ethical and safety policies.",
  "reinforced_ethics": {
    "do_no_harm": true,
    "respect_autonomy": true,
  }
}

⏳ Future Extensions

Simulator (Holter tool for Alignment Beat)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

custos_labs-0.1.0.tar.gz (44.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

custos_labs-0.1.0-py3-none-any.whl (72.0 kB view details)

Uploaded Python 3

File details

Details for the file custos_labs-0.1.0.tar.gz.

File metadata

  • Download URL: custos_labs-0.1.0.tar.gz
  • Upload date:
  • Size: 44.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for custos_labs-0.1.0.tar.gz
Algorithm Hash digest
SHA256 976534f9987567436d63089ddf5f71b50cee7cf8141d9a26ef89d67c8bf31ca7
MD5 31e7e27e489d9863b0c6de1afe43b687
BLAKE2b-256 df0dd9daf7deb6fec5b76d2f23e375e6969d4243f1a18339531a588fee3105a8

See more details on using hashes here.

File details

Details for the file custos_labs-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: custos_labs-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 72.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for custos_labs-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b19115add4edcdb55c449d77062bc24a52e086839905e5c594178fb72f969681
MD5 287d862382f46e6ddc8b7d8dcbda6d59
BLAKE2b-256 65b20d2f33cc2ee30e5a549805abb27c10290dcf51c490685e994176e709f24d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page