UNPKG

agentfootprint

Version:

The explainable agent framework — backtrack a wrong answer to the exact context that caused it (evidence, not guesses). Built on footprintjs.

75 lines • 4.89 kB
"use strict"; /** * agentfootprint/security — cross-cutting authorization + governance. * * Permissions are NOT context engineering — they're a guard ON * context-engineering operations (tool dispatch, skill activation, * memory writes, output emission). That's why this lives in its own * subpath, parallel to `agentfootprint/providers` and the * `agentfootprint/memory-*` and `agentfootprint/providers` subpaths. * * Today's surface is small and data-driven on purpose: one role * allowlist primitive that satisfies BOTH the v2.4 `PermissionChecker` * interface AND a sync `isAllowed(toolId)` predicate for use with * `gatedTools` from `agentfootprint/providers`. * * There is no shipped REMOTE policy engine. A remote checker implements * `PermissionChecker` with a `check()` method supplied by the application. * * A local allowlist and a remote policy engine differ in one way that * matters here: the local one can answer synchronously, so it doubles * as a `gatedTools` predicate; a remote one cannot, so it plugs in ONLY * as `permissionChecker`. That is not a limitation of either — the gate * decides what the model is shown, the checker decides what actually * runs, and they compose without knowing about each other. * * Future additions (capability gating, gate_open flows, audit logs) * land here without expanding the public root barrel. * * @example * import { PermissionPolicy } from 'agentfootprint/security'; * import { gatedTools, staticTools } from 'agentfootprint/providers'; * * const policy = PermissionPolicy.fromRoles( * { * readonly: ['lookup', 'list_skills', 'read_skill'], * admin: ['lookup', 'list_skills', 'read_skill', 'write', 'delete'], * }, * 'readonly', * ); * * const provider = gatedTools( * staticTools(allTools), * (name) => policy.isAllowed(name), * ); * * const agent = Agent.create({ provider, model, permissionChecker: policy }).build(); */ Object.defineProperty(exports, "__esModule", { value: true }); exports.checkerGoverns = exports.skillIdFromTarget = exports.skillTarget = exports.SKILL_TARGET_PREFIX = exports.conversationRedaction = exports.REDACTED_PLACEHOLDER = exports.redactThinkingBlocks = exports.SYNTHETIC_DENY_PREFIX = exports.extractSequence = exports.PolicyHaltError = exports.PermissionPolicy = void 0; var PermissionPolicy_js_1 = require("./PermissionPolicy.js"); Object.defineProperty(exports, "PermissionPolicy", { enumerable: true, get: function () { return PermissionPolicy_js_1.PermissionPolicy; } }); var PolicyHaltError_js_1 = require("./PolicyHaltError.js"); Object.defineProperty(exports, "PolicyHaltError", { enumerable: true, get: function () { return PolicyHaltError_js_1.PolicyHaltError; } }); var extractSequence_js_1 = require("./extractSequence.js"); Object.defineProperty(exports, "extractSequence", { enumerable: true, get: function () { return extractSequence_js_1.extractSequence; } }); Object.defineProperty(exports, "SYNTHETIC_DENY_PREFIX", { enumerable: true, get: function () { return extractSequence_js_1.SYNTHETIC_DENY_PREFIX; } }); var thinkingRedaction_js_1 = require("./thinkingRedaction.js"); Object.defineProperty(exports, "redactThinkingBlocks", { enumerable: true, get: function () { return thinkingRedaction_js_1.redactThinkingBlocks; } }); Object.defineProperty(exports, "REDACTED_PLACEHOLDER", { enumerable: true, get: function () { return thinkingRedaction_js_1.REDACTED_PLACEHOLDER; } }); // The names an agent's record carries the conversation under, as one policy // for `Agent.create({ redact })` — the library's vocabulary, joined with yours. var conversation_js_1 = require("../redaction/conversation.js"); Object.defineProperty(exports, "conversationRedaction", { enumerable: true, get: function () { return conversation_js_1.conversationRedaction; } }); // The `skill:<id>` target convention (9.11.0) — one owner, so a custom checker // spells a skill target exactly as the agent produces it. var skillTarget_js_1 = require("./skillTarget.js"); Object.defineProperty(exports, "SKILL_TARGET_PREFIX", { enumerable: true, get: function () { return skillTarget_js_1.SKILL_TARGET_PREFIX; } }); Object.defineProperty(exports, "skillTarget", { enumerable: true, get: function () { return skillTarget_js_1.skillTarget; } }); Object.defineProperty(exports, "skillIdFromTarget", { enumerable: true, get: function () { return skillTarget_js_1.skillIdFromTarget; } }); // The one question the dispatch loop asks a checker before sending it anything // beyond `'tool_call'`. Exported so a custom checker's own tests can assert the // same answer the framework will get. var types_js_1 = require("../provider-contract/types.js"); Object.defineProperty(exports, "checkerGoverns", { enumerable: true, get: function () { return types_js_1.checkerGoverns; } }); //# sourceMappingURL=index.js.map