Creating Mandates
This guide covers advanced patterns for creating mandates, including multi-action scopes, nested constraints, and template-based creation.
Work in Progress
This guide is currently being written. Check back soon for the full content.
Using Mandate Templates
Mandate templates provide pre-configured delegation blueprints for common use cases. Instead of manually specifying every action and constraint, you can use a template from your industry taxonomy.
import { MandaitorClient } from "@mandaitor/sdk";
const client = new MandaitorClient({
apiKey: process.env.MANDAITOR_API_KEY!,
tenantId: "tnt_your_tenant_id",
});
const mandate = await client.createMandate({
principal: {
type: "NATURAL_PERSON",
subject_id: "user:project-manager@example.com",
},
delegate: {
type: "AGENT",
subject_id: "monco:agent:validation-v3",
},
scope: {
actions: ["construction.validation.approve", "construction.validation.flag"],
resources: ["monco:project:proj_12345/*"],
effect: "ALLOW",
},
constraints: {
time: { duration: "P90D" },
},
});
Mandate Lifecycle
After creation, mandates can be managed through their lifecycle:
- Suspend: Temporarily disable a mandate without revoking it.
- Reactivate: Re-enable a suspended mandate.
- Revoke: Permanently disable a mandate.