展示HN:我15岁,大量发布了13.4万行代码来约束人工智能代理。
Show HN: I'm 15. I mass published 134K lines to hold AI agents accountable

原始链接: https://github.com/nobulexdev/nobulex

Nobulex 是一种开源协议,旨在在新兴的 AI 代理经济中建立信任。它允许 AI 代理对其行为做出可验证的承诺——它们*将*和*不会*做的事情——并因违规行为而面临经济后果。与审计复杂的神经网络不同,Nobulex 专注于根据预定义规则审计*行动*。 Nobulex 的核心在于“契约”,使用专用 DSL 定义,指定允许和禁止的行动以及条件逻辑。这些契约与代理身份(W3C DID)相关联,行动以防篡改的方式记录。一个确定性的验证过程确认合规性,识别任何违规行为。 Nobulex 提供分层执行:利用可信执行环境 (TEE) 用于高风险场景,并利用链上质押/罚没机制用于更广泛的应用。它提供了一套用于身份创建、契约定义、行动记录、验证和执行的软件包,并内置了可组合性。本质上,Nobulex 旨在成为“AI 代理的 HTTPS”,实现无需信任的协议和可靠的代理行为。

## Nobulex:AI 代理问责项目总结 一位15岁的开发者 (nobulexdev) 发布了13.4万行TypeScript代码 (Nobulex),旨在提供AI代理行为的密码学证明,以应对即将到来的欧盟AI法案对可审计追踪的要求。该项目专注于使代理能够签署“契约”——对特定规则的承诺——在运行时强制执行这些契约,并以可验证的哈希链方式记录操作。 虽然核心密码学组件相对较小 (~3-4千行),但该项目包含大量的适配器和测试。讨论的重点是,当开发者控制整个堆栈时,密码学是否真的必要,以及该系统是否提供真正的不可否认性,还是仅仅验证了特定中间件的处理。 开发者澄清Nobulex专为多方场景设计,在这些场景中独立验证至关重要(例如,客户验证代理的合规性)。反馈强调了小型、可审计的核心的重要性,并质疑对AI辅助代码生成的过度依赖。开发者现在正专注于将核心基本元素与特定于应用程序的层分离。
相关文章

原文

The accountability primitive for AI agents. Cryptographic behavioral commitments with trustless verification.

Nobulex is an open protocol (MIT license) that enables autonomous AI agents to declare what they will and won't do, prove they followed through, and face economic consequences if they didn't. The way HTTPS enabled e-commerce by making connections trustworthy, Nobulex enables the agent economy by making behavior trustworthy.

CI Packages License TypeScript

You can't audit a neural network. But you can audit actions against stated commitments.

verify(covenant, actionLog) → { compliant: boolean, violations: Violation[] }

This is always decidable, always deterministic, always efficient.

npm install @nobulex/identity @nobulex/covenant-lang @nobulex/middleware @nobulex/verification
import { createDID } from '@nobulex/identity';
import { parseSource } from '@nobulex/covenant-lang';
import { EnforcementMiddleware } from '@nobulex/middleware';
import { verify } from '@nobulex/verification';

// 1. Create an agent identity
const agent = await createDID();

// 2. Write a covenant in the DSL
const spec = parseSource(`
  covenant SafeTrader {
    permit read;
    permit transfer (amount <= 500);
    forbid transfer (amount > 500);
    forbid delete;
  }
`);

// 3. Enforce with middleware
const mw = new EnforcementMiddleware({ agentDid: agent.did, spec });

// $300 transfer — allowed
await mw.execute(
  { action: 'transfer', params: { amount: 300 } },
  async () => ({ success: true }),
);

// $600 transfer — BLOCKED by covenant
await mw.execute(
  { action: 'transfer', params: { amount: 600 } },
  async () => ({ success: true }),  // never executes
);

// 4. Verify compliance
const result = verify(spec, mw.getLog());
console.log(result.compliant);    // true
console.log(result.violations);   // []
# Primitive What It Does Package
1 Identity W3C DID for every agent (did:nobulex:) with Ed25519 keys @nobulex/identity
2 Covenant Cedar-inspired DSL: permit, forbid, require with conditions @nobulex/covenant-lang
3 Attestation W3C Verifiable Credential binding agent to covenant @nobulex/core-types
4 Action Log SHA-256 hash-chained tamper-evident record with Merkle proofs @nobulex/action-log
5 Verification Deterministic verify(covenant, log) with violation proofs @nobulex/verification
6 Enforcement On-chain staking/slashing with escalation @nobulex/contracts
Tier Mechanism Guarantee When to Use
Tier 1 TEE Middleware (Intel SGX / AMD SEV) Forbidden actions physically cannot execute High-stakes: financial, medical, legal
Tier 2 Staking / Slashing (on-chain) Violations are economically irrational General purpose: commerce, data access
┌─────────────────────────────────────────────────────────────┐
│                        Platform                              │
│          cli  ·  sdk  ·  elizaos-plugin                      │
├─────────────────────────────────────────────────────────────┤
│                    Covenant Primitives                        │
│                                                              │
│  ┌──────────┐  ┌──────────────┐  ┌────────────┐             │
│  │ identity │  │ covenant-lang│  │ action-log │             │
│  │  (DID)   │  │    (DSL)     │  │(hash-chain)│             │
│  └──────────┘  └──────────────┘  └────────────┘             │
│                                                              │
│  ┌────────────┐  ┌──────────────┐  ┌───────────────┐        │
│  │ middleware  │  │ verification │  │ composability │        │
│  │(pre-exec)  │  │ (post-hoc)   │  │(trust graph)  │        │
│  └────────────┘  └──────────────┘  └───────────────┘        │
│                                                              │
│  ┌─────┐  ┌───────────┐                                     │
│  │ tee │  │ contracts │                                     │
│  │(SGX)│  │(Solidity) │                                     │
│  └─────┘  └───────────┘                                     │
├─────────────────────────────────────────────────────────────┤
│                      Foundation                              │
│        core-types  ·  crypto  ·  evm                         │
└─────────────────────────────────────────────────────────────┘
covenant SafeTrader {
  permit read;
  permit transfer (amount <= 500);
  forbid transfer (amount > 500);
  forbid delete;
  require counterparty.compliance_score >= 0.8;
}

Forbid wins. If any forbid matches, the action is blocked regardless of permits. Default deny for unmatched actions. Conditions support >, <, >=, <=, ==, != on numeric, string, and boolean fields.

On-Chain Contracts (Solidity)

Three contracts deployed to Ethereum (Sepolia testnet):

Contract Purpose
CovenantRegistry Register covenant hashes on-chain, prevent duplicates
StakeManager Stake ETH on covenants, lock/slash on violation
SlashingJudge Submit violations, compute escalating penalties
npx tsx demo/covenant-demo.ts

Creates two agents, authors a covenant, enforces it via middleware, blocks a forbidden transfer, and verifies compliance — all in one script.

git clone https://github.com/agbusiness195/NOBULEX.git
cd NOBULEX
npm install
npx vitest run    # 6,062 tests, 112 files, 0 failures
Bitcoin Ethereum Nobulex
What it trusts Monetary transfers Contract execution Agent behavior
Trust mechanism Proof of Work Proof of Stake Proof of Compliance
What's verified Transaction validity State transitions Behavioral commitments
Guarantee Trustless money Trustless agreements Trustless agents

MIT

联系我们 contact @ memedata.com