TuringFlow is a Rust foundation for secure agent orchestration with:
- a transport plane (
TFPv1) for agent-to-agent communication, - a kernel-like syscall/policy layer for controlled host access,
- a user communication plane for channels like Matrix/email/webhook,
- SQLite-backed durability (registry, dedupe, acks, audit, user queues).
TuringFlow separates concerns into two explicit planes.
-
Inter-agent plane (
TFPv1)- registration and heartbeat leases,
- route resolution,
- message forward + retry,
- replay-window checks and deduplication,
- ACK persistence.
-
User plane (
user.*kernel syscalls)user.ingest: user -> agent queue,user.recv: agent consumes user messages,user.send: agent -> user queue,user.inbox: inspect outbound queue,user.route.resolve: channel selection policy.
Channel connectors (currently Matrix worker) map external events to this user plane and do not impersonate TFPv1 peers.
src/lib.rs: crate-level architecture and module exportssrc/bin/turingflowd.rs: mTLS daemon, TFPv1 API, background workerssrc/main.rs:turingflowCLI entrypointsrc/kernel/*: policy engine, syscall dispatch, audit sinkssrc/tfpv1/*: protocol types, router, storage backendssrc/user_channels/*: channel config + Matrix workersrc/commands/*: CLI command handlersconfig/*.yaml: runtime configurationdocs/: user/dev/ops documentation
- Principals are evaluated with precedence:
agent_tool:*thenagent:*. - Policy is deny-by-default.
- Message ids are used for idempotency/dedupe.
- Leases expire automatically if heartbeats stop.
- All kernel decisions are auditable (
syscall_audit_log). - Provider traits are
Send + Syncfor safe concurrent access.
- Rust stable toolchain
- SQLite (bundled through
rusqlite) - Certificates configured for daemon mTLS
cargo buildcargo run --bin turingflow -- --helpcargo run --bin turingflowd -- --helpcargo run --bin turingflowd -- \
--config config/turingflowd.yaml \
--kingdoms-config config/kingdoms.yaml \
--channels-config config/channels.yaml- Queue user message:
cargo run --bin turingflow -- chat --message "Hello" --channel cli --thread-id user-main- Show outbound user inbox:
cargo run --bin turingflow -- inbox --limit 20- Debug user queues (local SQLite view):
cargo run --bin turingflow -- debug-user --limit 50 --include-acked --include-delivered- Run multimodal agentic demo:
FIREWORKS_API_KEY=... cargo run --bin turingflow -- test_agent2- Run multimodal agentic demo on OpenAI-compatible endpoint:
OPENAI_API_KEY=... cargo run --bin turingflow -- test_agent2_openaiconfig/turingflowd.yaml: daemon socket, TLS, storage, limits, loggingconfig/kingdoms.yaml: allowed kingdoms and quotasconfig/policies.yaml: syscall authorization policyconfig/channels.yaml: user channel connectors (Matrix phase 1)
cargo test --lib
cargo test --test tfpv1_integration
cargo test --test turingflowd_http_integration- Full index:
docs/README.md - User guides:
docs/user/* - Developer architecture:
docs/dev/* - Operations:
docs/ops/*
