@navirondynamics/accord
v1.3.0
Published
A policy-first identity and access engine for modular systems.
Downloads
46
Maintainers
Readme
Accord
Accord is a policy-first identity and access platform for Node.js.
It treats access not as scattered application logic, but as a formal agreement between identities, systems, and resources - evaluated through declarative, versioned policies.
New in v1.3: Policy Simulation, Version Control, Rollback, Impact Analysis, and Visual Graph APIs.
Table of Contents
- Why Accord
- Key Features
- Installation
- Quick Start (Server Mode)
- Usage (Library Mode)
- v1.3 New Features
- Framework Integration
- CLI Tool
- Documentation
- License
🚀 Why Accord?
v1.1 was a library. v1.2 was a platform. v1.3 is a control plane.
Modern authorization is fragmented:
- Authentication in one service
- Roles in another
- Access logic scattered across microservices
Accord centralizes authorization into a single governance layer, acting as the System of Record for access control across your platform.
"ACCORD v1.3 transforms authorization from static rules into a visible, testable, and version-controlled system."
Key Features
- 🚀 Platform Mode – Standalone HTTP server for centralized decision making.
- 🗄️ Database-First – Pluggable storage adapters (Postgres, File) with JSONB optimization.
- 🤝 JIT Provisioning – Automatic identity creation on first login.
- 📊 Explainability – Full decision traces (latency, matched policies) for debugging.
- 🔍 Observability – Built-in audit logging (console, file, & webhooks).
- 📝 Policy as Code – JSON and YAML configuration support.
- 🛡️ Reliability – Zod-based schema validation.
- 🧩 Framework Adapters – Express, NestJS, and Fastify integrations.
- 🧪 Simulation Engine – Dry-run policies without touching production.
📦 Installation
npm install @navirondynamics/accord🛠️ Quick Start (Server Mode)
The fastest way to experience v1.3 is running Accord as a standalone service.
1. Configure Environment
Create a .env file:
DATABASE_URL=postgres://user:password@localhost:5432/accord
PORT=8080
JIT_ENABLED=true
WEBHOOK_URL=https://hooks.your-siem.com/webhook2. Run the Server
npx @navirondynamics/accord serve --adapter postgres3. Create a Policy
curl -X POST http://localhost:8080/api/v1/policies \
-H "Content-Type: application/json" \
-d '{
"id": "policy-view-all",
"version": "1.0",
"effect": "allow",
"subject": { "type": "user" },
"action": ["view"],
"resource": { "type": "document" }
}'4. Check Access
curl -X POST http://localhost:8080/api/v1/check \
-H "Content-Type: application/json" \
-d '{
"userId": "alice",
"action": "view",
"resource": { "type": "document" }
}'Result: Alice is automatically created (JIT) and allowed.
🧩 Usage (Library Mode)
You can also embed Accord directly into your Node.js applications.
const { Accord, PostgresStoreAdapter } = require('@navirondynamics/accord');
// 1. Initialize Storage
const adapter = new PostgresStoreAdapter({
connectionString: process.env.DATABASE_URL,
});
// 2. Initialize Accord (Use static create for async safety)
const accord = await Accord.create({
adapter,
jit: { enabled: true, defaultStatus: 'active' },
});
// 3. Check Access
const decision = await accord.check('alice', 'view', { type: 'document' });
if (decision.decision === 'allow') {
console.log(`Allowed by ${decision.policy_id}`);
console.log(`Latency: ${decision.trace.latencyMs}ms`);
}🌟 v1.3 New Features
Policy Simulation (Dry Run)
Test policies without touching production data.
const mockIdentity = {
id: 'test',
type: 'user',
status: 'active',
attributes: { role: 'admin' },
};
const result = await accord.simulate(mockIdentity, 'delete', {
type: 'booking',
});Policy Rollback
Revert a broken policy instantly via CLI.
accord policy rollback billing-access --to 1.2Visual Graph API
Fetch the permission graph for visualization.
curl http://localhost:8080/api/v1/policies/graph🛡️ Framework Integration
NestJS
import { AccordGuard } from '@navirondynamics/accord/adapters/nest';
@Controller('bookings')
export class BookingController {
@UseGuards(
new AccordGuard({
accordInstance: accord, // Use your Accord instance
action: 'delete',
resourceType: 'booking',
})
)
@Delete(':id')
deleteBooking(@Param('id') id: string) {
// Only authorized users reach here
}
}Express
const { protect } = require('@navirondynamics/accord/adapters/express');
app.delete(
'/bookings/:id',
protect({
accordInstance: accord,
action: 'delete',
resourceType: 'booking',
}),
(req, res) => {
res.send('Deleted');
}
);🔧 CLI Tool
Validate policies, manage versions, or run the server directly from your terminal.
# Run the Platform Server
npx @navirondynamics/accord serve --adapter postgres --port 8080
# Validate a local policy file
npx @navirondynamics/accord validate ./config/policies.yaml
# Dry-run a check (File mode)
npx @navirondynamics/accord eval -i user_123 -a delete -r booking
# v1.3: Rollback a policy
npx @navirondynamics/accord policy rollback <policy-id> --to <version>📚 Documentation
- Getting Started – Installation and core concepts
- Platform vs Library – Choosing the right deployment mode
- Observability – Interpreting Decision Traces
- JIT Provisioning – Configuring identity mapping
- Adapters – Setting up Postgres or File storage
- API Reference – Management API documentation
📜 License
ISC
