@atbash/eliza-plugin
v0.2.1
Published
Atbash safety plugin for ElizaOS agents
Readme
@atbash/eliza-plugin
Atbash safety plugin for ElizaOS agents.
Use this when your agent already runs inside ElizaOS and you want Atbash checks around sensitive actions, current policy context in runtime, and best-effort audit logging after action completion.
What It Adds
atbashPluginRegisters the Atbash service, policy provider, audit evaluator, and explicit judge action.AtbashServiceLoads the Atbash agent identity from Eliza runtime settings.ATBASH_JUDGEExplicit Eliza action that asks Atbash for a safety verdict.withAtbashGuard(handler)Wraps sensitive action handlers so Atbash decides before the real handler runs.policyProviderExposes current policy and jail status to the runtime.auditEvaluatorLogs completed action text to Atbash on a best-effort basis.
Runtime Inputs
ATBASH_AGENT_PRIVKEYRequired. Used to derive the Atbash agent identity and sign requests.ATBASH_ENDPOINTOptional. Overrides the default Atbash API endpoint.
Runtime Model
At startup:
- Eliza loads
atbashPlugin. AtbashServicereadsATBASH_AGENT_PRIVKEY.- The service derives the public key and creates one reusable Atbash client.
- The service checks whether the agent is registered and warns if it is not.
During runtime:
policyProvidercan expose current safety status.ATBASH_JUDGEcan request an explicit verdict.withAtbashGuard()checks Atbash before sensitive action handlers run.auditEvaluatorlogs completed activity without crashing the agent if logging fails.
Guarded Actions
Wrap the action closest to the side effect:
import { withAtbashGuard } from "@atbash/eliza-plugin";
export const sendFundsAction = {
name: "SEND_FUNDS",
description: "Send funds to an external destination",
validate: async () => true,
handler: withAtbashGuard(async (_runtime, message) => {
await submitTransfer(message);
return { success: true, text: "Transfer submitted" };
}),
};Verdict behavior:
ALLOWOriginal action handler runs.HOLDOriginal action handler does not run. The action returns a held result with the AtbashtoolCallId.BLOCKOriginal action handler does not run. The action returns a blocked result with the policy reason.ERROROriginal action handler does not run. The action returns an error result.
Explicit Judge Action
ATBASH_JUDGE asks Atbash for a verdict and returns the decision in data.
Use it when the agent or app needs to inspect safety before choosing a next step. It does not execute your business action.
Example
The runtime example uses a real Eliza AgentRuntime, an in-memory adapter, and a simulated guarded transfer action.
npm run build
ATBASH_AGENT_PRIVKEY=your_key_here npm run exampleOptional endpoint:
ATBASH_AGENT_PRIVKEY=your_key_here ATBASH_ENDPOINT=https://atbash.ai npm run example