@agenticprimitives/vault-authority
v0.0.0-alpha.6
Published
Vault subject authority primitives: role assignments scoped to vault-resident subjects, vault-record-scope grant compilation, and pure runtime decisions.
Maintainers
Readme
@agenticprimitives/vault-authority
Part of Agentic Primitives — the open-source trust substrate for agentic applications: identity that can sign, authority checked at act time, evidence the owner carries. Developer kit · All packages
Pure helpers for authority over vault-resident subjects.
This package bridges three existing primitives:
RoleAssignmentfrom@agenticprimitives/organizationVaultRecordScopeGrantfrom@agenticprimitives/delegation- owner-vault resource naming from
@agenticprimitives/vault
It does not persist, sign, read chain state, call MCP/A2A, or verify entitlements. Callers pass already verified facts into deterministic helpers.
What It Owns
- subject refs: the thing a vault role is about
- role definitions: capabilities plus vault-record-scope grant templates
- grant compilation: role definition + subject ->
VaultRecordScopeGrant[] - projection: role assignment + definition -> app-readable grant view
- authorization: active assignment + materializing authority + record scope -> allow/deny
Core Rule
RoleAssignment manages domain-subject responsibility. Delegation/caveats execute authority. Entitlements prove access.
A role with no valid materializing authority authorizes nothing.
Minimal Example
import {
authorizeVaultSubjectOperation,
compileVaultRecordScopeGrants,
type VaultAuthorityRoleDefinition,
} from '@agenticprimitives/vault-authority';
const definition: VaultAuthorityRoleDefinition = {
roleDefinitionId: 'roledef:example.manager@1',
name: 'manager',
version: '1',
allowedScopes: ['resource'],
capabilities: ['example.manage'],
grantTemplates: [
{
server: 'example-vault',
resources: ['vault:example.subject:{scopeRef}:*'],
ops: ['read', 'write'],
},
],
};
const subject = {
vaultOwner: '0x0000000000000000000000000000000000000001',
scope: 'resource' as const,
scopeRef: 'subject:123',
};
const recordScopes = compileVaultRecordScopeGrants({ definition, subject });
const decision = authorizeVaultSubjectOperation({
assignment,
definition,
subject,
hasMaterializingAuthority: true,
recordScopes,
request: {
server: 'example-vault',
resource: 'vault:example.subject:subject:123:title',
op: 'write',
},
});Privacy
The package never creates a public registry of who manages which subject. Assignments, wires, and entitlements live off-chain in vault/Home/runtime stores. Chain state remains hash/signature/revocation verification.
