@agentbouncr/core
v0.2.1
Published
Agent Governance Framework — Core Engine (Permission Layer, Policy Engine, Audit Trail)
Readme
@agentbouncr/core
The governance layer for AI agents. Deterministic rules — not another AI — decide what each agent can do. Policy Engine, Audit Trail, Kill-Switch, Event System, and Injection Detection. Works with LangChain, Vercel AI SDK, OpenAI, CrewAI, or any agent framework.
Installation
npm install @agentbouncr/coreQuick Start
import { GovernanceMiddleware } from '@agentbouncr/core';
const governance = new GovernanceMiddleware();
governance.setPolicy({
name: 'basic-security',
version: '1.0',
rules: [
{
tool: 'file_write',
effect: 'deny',
condition: { path: { startsWith: '/etc/' } },
reason: 'Writing to /etc/ is not permitted',
},
{ tool: '*', effect: 'allow' },
],
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
});
const result = await governance.evaluate({
agentId: 'my-agent',
tool: 'file_write',
params: { path: '/etc/passwd' },
});
console.log(result.allowed); // falseFor full documentation, examples, and architecture overview, see the main repository.
Upgrading to 0.2.0
Version 0.2.0 introduces a validated Agent State Machine with 7 states (was 4). Key breaking changes:
'running'status renamed to'active'- New states:
'idle','suspended','decommissioned' emergencyStop()andresetKillSwitch()are nowasync- Invalid state transitions throw
GovernanceError(code:INVALID_TRANSITION)
See CHANGELOG.md for the full migration guide.
License
Elastic License 2.0 (ELv2) — see LICENSE
