Skip to main content

FLUX Registry — Pre-compiled agent policies, installable and runnable

Project description

FLUX Registry

npm for agent policies. Pre-compiled FLUX bytecode, installable and runnable.

Pre-compiled agent policies, installable and runnable. The registry is a static JSON index on GitHub — no server required. The CLI downloads from raw.githubusercontent.com and caches policies locally in ~/.flux/policies/.

Install

pip install flux-registry

Quick Start

# Browse available policies
flux list --remote

# Install a policy
flux install deadband-controller

# Run it
flux run deadband-controller --input temperature=72
# Output: action=idle

flux run deadband-controller --input temperature=80
# Output: action=cool

flux run deadband-controller --input temperature=60
# Output: action=heat

# Get details
flux info deadband-controller

Commands

Command Description
flux install <policy> Install a policy from the remote registry
flux list [--remote] List installed (or remote) policies
flux info <policy> Show detailed metadata, inputs, outputs
flux run <policy> --input K=V Execute a policy with given inputs
flux remove <policy> Remove an installed policy
flux update-index Refresh the local registry cache

Available Policies

Policy Description Inputs Outputs
deadband-controller Thermostat with hysteresis — AC at 75°, heat at 65° temperature (°F) action: idle/cool/heat
budget-tracker Conservation budget enforcement — track resource depletion cost, budget remaining, status: ok/exceeded
rate-limiter Token bucket rate limiting — check and consume tokens tokens, cost remaining, allowed: denied/allowed
security-scanner Basic vulnerability detection — threshold-based policy check value, threshold verdict: safe/violation, severity

Policy Format

Each policy is a JSON file containing:

{
  "name": "deadband-controller",
  "version": "0.1.0",
  "description": "Thermostat deadband controller",
  "author": "SuperInstance",
  "bytecode": "<base64-encoded FLX0 binary>",
  "source": "deadband-controller.flx",
  "bytecode_hash": "sha256...",
  "bytecode_size": 32,
  "inputs": [{"name": "temperature", "type": "float", "register": "R0"}],
  "outputs": [{"name": "action", "type": "int", "register": "R1",
               "values": {"0": "idle", "1": "cool", "2": "heat"}}],
  "conservation": {"max_steps": 100, "memory_budget": 256},
  "conformance": "verified on flux-vm 0.1.0, fluxvm 0.1.0, flux-js 0.1.0",
  "tags": ["iot", "thermostat", "hvac"],
  "license": "MIT"
}

Architecture

┌──────────────────────────────────────────────────────┐
│                   FLUX Registry                       │
│                                                       │
│  GitHub (static JSON)          Local (~/.flux/)       │
│  ┌─────────────────┐          ┌──────────────────┐   │
│  │ registry/       │  install │ policies/        │   │
│  │   index.json    │ ───────▶ │   deadband.json  │   │
│  │   deadband.json │          │   budget.json    │   │
│  │   budget.json   │          └────────┬─────────┘   │
│  │   rate-limiter  │                   │              │
│  │   security.json │          ┌────────▼─────────┐   │
│  └─────────────────┘          │   flux CLI       │   │
│                               │   ┌────────────┐ │   │
│                               │   │ Mini FLUX  │ │   │
│                               │   │ VM (built  │ │   │
│                               │   │  in)       │ │   │
│                               │   └────────────┘ │   │
│                               └──────────────────┘   │
└──────────────────────────────────────────────────────┘

The mini FLUX VM is built into the CLI for zero-dependency local execution. For production use, policies can be run on any FLUX implementation:

Runtime Language Install
flux-vm Python pip install flux-vm
fluxvm Rust cargo add fluxvm
flux-js JavaScript npm install flux-js

All run the same bytecode — same policy, different shells.

Conservation Guarantees

Every policy declares conservation limits:

"conservation": {
  "max_steps": 100,
  "memory_budget": 256
}

The VM enforces these at runtime — a policy cannot exceed its step count or memory allocation. This makes FLUX policies safe to run as untrusted code.

Adding Policies

  1. Write a policy in .flx source
  2. Compile with flux-compiler
  3. Create a JSON manifest with bytecode + metadata
  4. Submit a PR to add it to registry/

License

MIT — Same bytecode, different shells. 🦀

Related

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

flux_registry-0.1.0.tar.gz (14.6 kB view details)

Uploaded Source

Built Distribution

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

flux_registry-0.1.0-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: flux_registry-0.1.0.tar.gz
  • Upload date:
  • Size: 14.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for flux_registry-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bd810b7c3dce750752f0f3938d2e59cead49fbbfa024439d17acf8a4145fe3e1
MD5 6601704d1f66ef098fd096e847501743
BLAKE2b-256 9a780b4f13040c34fd4b64b4f52b97d12a30a5174aa14257b5e48860f325c5ae

See more details on using hashes here.

File details

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

File metadata

  • Download URL: flux_registry-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for flux_registry-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8fbaa13dfff160d3b7209dcdc465281975c35fa59c24a9e5c26a2ffd6d1791d9
MD5 86dca56b90083003fdebe680a8ca0001
BLAKE2b-256 ef3e7a4b1389252c158fd1fc91f3ee4bda3b0ef4e5dccad1286d062accdf6c34

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