halofy README

The project's README from github.com/halofyai/halofy. As one markdown file: README.md.

Halofy

The open access and governance layer for AI agents across your organization.
Give every agent the right organizational context through one identity and policy model, with provenance, audit, and signed erasure.

Get started Architecture Build a driver Discussions

CI AGPL-3.0-or-later Node 22 Offline ready No telemetry


As AI spreads across an organization, every agent needs access to shared context without becoming its own identity system, policy engine, or audit silo. Halofy sits between organizational knowledge and the agents that use it. It resolves identity, enforces access, governs change, records every outcome, and makes erasure independently verifiable.

Underneath that governance boundary, Halofy maintains durable context and keeps retrieval replaceable. The result is infrastructure you can inspect, self-host, run offline, and connect to any agent over MCP or HTTP.

Why Halofy

Organization-wide access Governed context Open infrastructure
Agents, applications, and operators use the same server-resolved identity, namespace ACL, roles, and policy boundary over MCP or HTTP. Every change follows one auditable path with provenance, supersedence, append-only history, and signed erasure. Postgres remains the authority while retrieval engines plug in through an ACL-scoped, read-only driver interface.

What ships in this repository

Quickstart

Run the complete offline story

git clone https://github.com/halofyai/halofy.git
cd halofy/kernel
npm ci
npm run demo

No API key. No database server. No model download. No network call. The demo boots the real kernel on embedded PGlite, then exercises pinning, assembly, writes, hybrid search, an L3 context fault, audit, import, fragmentation, and signed erasure.

== T0 ·· boot in-memory, pin the refund policy, assemble the working set
booted: embedder=hash(dim=256) llm=stub

== T3 ·· mem_fault - page missing context in from L3
fault: hit=true source=L3 injected=2

== T7 ·· mem.forget - erase the customer and mint a signed certificate
certificate 01... verifyCertificate === true
after forget: mem_search surfaces 0 matching facts

demo complete - kernel closed.

Then prove the kernel and its retrieval boundary:

npm test
npx tsx src/cli.ts conformance baseline

The current standalone verification passes 2,678 tests across 205 files and all 6/6 driver-conformance checks. Timings and generated identifiers vary by machine; the behavior does not.

Start the API and control room

cd kernel
npm run serve

Open http://localhost:8787/console/login. For a durable self-hosted deployment with Postgres, generated keys, and Docker Compose, follow the self-hosting guide.

Connect an agent over MCP

cd kernel
npx tsx src/cli.ts keygen org/support/agent-1 user:dana owner
HALOMEM_API_KEY=hm_... npm run mcp

The API key resolves the namespace, actor, and role server-side. MCP tool schemas do not accept caller-asserted identity fields.

Architecture

The important boundaries

  1. Identity is server-owned. Namespace, actor, role, and source scope come from the credential, never from a request body.
  2. Access is organization-wide and policy-bound. The same ACL and role decisions apply across agents, applications, operators, MCP, and HTTP.
  3. Changes are governed. Corrections close the prior fact's validity interval and link the replacement. They do not overwrite history.
  4. Reads are delegated. A retriever sees only an ACL-scoped ScopedView and can return references only. It cannot write or reach audit/storage modules.
  5. Postgres is the authority. Context, embeddings, policy, provenance, tombstones, and audit live together. PGlite embeds the same model for local development and tests.
  6. Every outcome audits. Success, denial, miss, brownout, and error paths all append an event.

Read the architecture guide for the syscall pipeline, ACL examples, SQL, tiering, brownout behavior, and a per-directory source map.

Security model

The core namespace rule is deliberately small: a caller in namespace N sees rows belonging to N or an exact /-split ancestor of N. Siblings and descendants remain invisible unless an explicit, audited administration path allows a subtree operation.

caller: org/support/agent-1

org                          visible     ancestor
org/support                  visible     ancestor
org/support/agent-1          visible     self
org/support/agent-2          hidden      sibling
org/support/agent-1/scratch  hidden      descendant
org/sales                    hidden      sibling

The query layer enforces this rule with exact ancestor matching. Retrieval drivers do not reimplement it; they receive an already-scoped view. See the threat model for the known partial controls and adversarial cases, and the architecture guide for the worked ACL queries.

Open by design

The standalone build is not a trial:

Property Standalone behavior
Licence/activation No licence key, edition flag, activation, or entitlement check
Packaging quota None; the public QuotaPort defaults to UNMETERED
Capacity controls Operator-owned policy rate limits and model-budget brownout only
Telemetry None; no usage beacon or Halofy phone-home
Models Offline deterministic defaults; optional direct Anthropic, OpenAI-compatible, OpenAI embedding, and Azure OpenAI configuration
Database Embedded PGlite by default; regular Postgres/pgvector for durable deployments
Export Open schema, export, manifest, and erasure paths

The permanent boundary is documented in OPEN-SOURCE-SCOPE.md. The practical feature matrix is in open build vs. managed service.

Deliberately commercial

Halofy's managed operations, not the access and governance boundary, fund the open kernel:

None of those components is required to run this repository. The connector framework, baseline model plumbing, governed context lifecycle, access control, console, self-host stack, and test suite are present and runnable.

Documentation

Guide Use it when you want to…
Getting started Go from clone to first key, write, search, MCP connection, and real model configuration
Architecture Trace requests, understand custody, or change the kernel
Driver kit Build and validate a retrieval cartridge
Self-hosting Run Postgres, Docker Compose, backups, restores, and upgrades
Threat model Review assets, boundaries, adversaries, and known partial controls
Open-source scope See what stays open and how that promise changes
Kernel reference Find scripts, source directories, environment variables, and development commands

The full index is in docs/README.md.

Contributing

Start with CONTRIBUTING.md. Security-sensitive changes to authentication, tenancy, ACLs, migrations, encryption, audit, erasure, or the write/retrieval boundary require adversarial review and regression coverage.

Security reports belong in the private channels described by SECURITY.md, not in public issues. Community expectations are in CODE_OF_CONDUCT.md.

License

The kernel and console are AGPL-3.0-or-later. Named client and extension subtrees are Apache-2.0 so they can be embedded without relicensing the host application. These include kernel/src/driver/, kernel/src/mcp/, and kernel/integrations/. See LICENSING.md and NOTICE for the authoritative file-by-file boundary.

The Halofy name is a trademark; neither software licence grants trademark rights. See TRADEMARK.md.

halofy (halofyai/halofy)

Searching Database…

319 ·GitHub
这是什么?Halofy 是一个访问与治理层,位于组织的知识和使用知识的 AI 智能体之间,处理身份、策略、溯源、审计和签名擦除。
这是我导入的库,还是我运行的服务器?它是一个通过 MCP 和 HTTP 暴露的自托管服务器/内核,并带有一个无框架的管理控制台(即“控制室”),用于管理访问、团队、数据源、策略和审计。
怎么让它跑起来?在内置 PGlite 上运行离线演示(无需 API 密钥、数据库服务器或网络调用)以查看完整的内核流程,然后启动 API 和控制室;要实现持久化部署,请按照自托管指南使用 Postgres 和 Docker Compose。
试用它需要 Postgres 数据库吗?不需要——快速入门默认使用内置 PGlite,本地开发和测试零配置;只有持久化的自托管部署才需要真正的 Postgres/pgvector 实例。
开源版本剔除了哪些内容?模型路由与花费归因、计费、托管的 Slack/Discord/WhatsApp/Google Chat 应用、托管的 SaaS 连接器目录、跨组织联邦查询以及调优过的提取提示词包,都属于付费托管服务,不在开源内核之列。
它如何决定哪些智能体可以看到哪些数据?每个调用方都会在服务端解析到一个命名空间,访问规则只允许它看到该命名空间或其精确祖先路径中的行;兄弟和子孙命名空间保持不可见,除非通过显式且经审计的管理操作将它们开放。
它自带哪些连接器?开箱即含四个公共连接器:filesystem、Postgres、Obsidian 和手动 CSV 导入,它们全部走同一条受治理的写入路径。
这里的擦除是怎么运作的?擦除采用加密签名并可独立验证,而非简单删除;普通的更正会关闭先前事实的有效区间并链接替代内容,而不是覆盖历史。
这个项目真的经过这种规模的测试吗?独立构建目前通过 205 个文件中的 2,678 项测试以及全部 6/6 项驱动一致性检查,测试在密闭通道中运行,使用内置 PGlite、确定性的桩 LLM 和零网络访问的哈希嵌入器。
Creator
halofyai
Size
2.7 MB
Stars
319
Updated
CommitAug 24
Age
1mo
Commits · 90 Days