← All lessons/Enterprise
47
Enterprise

Codios Authorization

Enforce authorization contracts on every write using the Codios system.

Prerequisite: Lesson 34 complete

What you'll learn

  • SAPIX_CODIOS_URL + SAPIX_CODIOS_API_KEY env vars
  • Codios called before every write — validates writing agent has a contract
  • SAPIX_REQUIRE_CODIOS=true — block writes if Codios is unreachable
  • Without SAPIX_REQUIRE_CODIOS — Codios failure degrades gracefully (allow + log)
  • Use case: multi-agent systems where you control which AI agents write to which strands
Challenge

Review Codios dashboard and understand contract setup. Set SAPIX_REQUIRE_CODIOS=false and confirm writes succeed.

Interactive Walkthrough

What you'll learn

Enforce authorization contracts on every write using the Codios system.

What Codios does

Codios is SapixDB's authorization contract layer. Before any write is accepted, SapixDB calls the Codios API to verify the writing agent has a valid contract authorizing that write.

This is designed for multi-agent systems where you want to enforce which AI agents can write to which strands.

Configure Codios

environment:
  SAPIX_CODIOS_URL:     "https://codios-api.midlantics.com"
  SAPIX_CODIOS_API_KEY: "codios_sk_..."
  SAPIX_REQUIRE_CODIOS: "true"

With SAPIX_REQUIRE_CODIOS=true, any write where Codios is unreachable or returns a rejection is blocked. Without it, Codios failures degrade gracefully (allow but log).

Without Codios

If SAPIX_CODIOS_URL is not set, SapixDB runs in open mode — all writes are accepted from any authenticated caller.

Challenge

Set SAPIX_REQUIRE_CODIOS=false (open mode) and confirm writes succeed. Review the Codios documentation for setting up your first contract.

---

← Previous
Lesson 46: SOX Compliance
Next →
Lesson 48: Python SDK