kavachos 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,69 @@
1
+ # kavachos
2
+
3
+ Auth OS for AI agents. Identity, permissions, delegation, and audit.
4
+
5
+ [![npm](https://img.shields.io/npm/v/kavachos)](https://www.npmjs.com/package/kavachos)
6
+ [![license](https://img.shields.io/badge/license-MIT-blue)](https://github.com/kavachos/kavachos/blob/main/LICENSE)
7
+
8
+ ## Install
9
+
10
+ ```bash
11
+ npm install kavachos
12
+ # or
13
+ pnpm add kavachos
14
+ ```
15
+
16
+ ## Quick start
17
+
18
+ ```typescript
19
+ import { createKavach } from 'kavachos';
20
+
21
+ const kavach = createKavach({
22
+ database: { provider: 'sqlite', url: 'kavach.db' },
23
+ });
24
+
25
+ // Create an agent with scoped permissions
26
+ const agent = await kavach.agent.create({
27
+ ownerId: 'user-123',
28
+ name: 'github-reader',
29
+ type: 'autonomous',
30
+ permissions: [
31
+ { resource: 'mcp:github:*', actions: ['read'] },
32
+ {
33
+ resource: 'mcp:deploy:production',
34
+ actions: ['execute'],
35
+ constraints: { requireApproval: true },
36
+ },
37
+ ],
38
+ });
39
+
40
+ // Authorize an action
41
+ const result = await kavach.authorize(agent.id, {
42
+ action: 'read',
43
+ resource: 'mcp:github:repos',
44
+ });
45
+ // { allowed: true, auditId: 'aud_...' }
46
+
47
+ // Query the audit trail
48
+ const logs = await kavach.audit.query({ agentId: agent.id });
49
+ ```
50
+
51
+ ## What's included
52
+
53
+ - **Agent identity** - create, scope, revoke, and rotate agent credentials. Each agent gets an opaque bearer token (`kv_...`) and a permanent audit identity.
54
+ - **Permission engine** - resource-based access control with colon-separated hierarchies (`mcp:github:*`) and wildcard matching. Constraints support rate limits, time windows, and human-in-the-loop approval gates.
55
+ - **Delegation chains** - an orchestrator can delegate a subset of its permissions to a sub-agent, with depth limits and expiry. Chains are auditable and revocable at any point.
56
+ - **Audit trail** - every authorization decision is written to an immutable log. Export as JSON or CSV for EU AI Act Article 12, SOC 2 CC6.1-CC7.2, and ISO 42001 compliance.
57
+ - **MCP OAuth 2.1** - spec-compliant authorization server for the Model Context Protocol, with PKCE (S256), Protected Resource Metadata (RFC 9728), and Resource Indicators (RFC 8707).
58
+
59
+ ## Full docs
60
+
61
+ [kavachos.com/docs](https://kavachos.com/docs)
62
+
63
+ ## Source
64
+
65
+ [github.com/kavachos/kavachos](https://github.com/kavachos/kavachos)
66
+
67
+ ## License
68
+
69
+ MIT
@@ -1,8 +1,8 @@
1
- import { D as Database, C as CreateAgentInput, A as AgentIdentity, d as AgentFilter, U as UpdateAgentInput } from '../types-fHHAt3tt.js';
2
- export { j as AgentConfig } from '../types-fHHAt3tt.js';
1
+ import { D as Database, C as CreateAgentInput, g as AgentIdentity, h as AgentFilter, U as UpdateAgentInput } from '../types-Xk83hv4O.js';
2
+ export { L as AgentConfig } from '../types-Xk83hv4O.js';
3
3
  import 'drizzle-orm/better-sqlite3';
4
4
  import 'drizzle-orm/sqlite-core';
5
- import '../types-C5htunW6.js';
5
+ import '../types-mwupB57A.js';
6
6
  import 'zod';
7
7
 
8
8
  interface AgentModuleConfig {
@@ -1,5 +1,5 @@
1
- export { createAgentModule } from '../chunk-DTCKF26N.js';
2
- import '../chunk-XSYYQH75.js';
1
+ export { createAgentModule } from '../chunk-5DT4DN4Y.js';
2
+ import '../chunk-V66UUIA7.js';
3
3
  import '../chunk-PZ5AY32C.js';
4
4
  //# sourceMappingURL=index.js.map
5
5
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
- import { D as Database, g as AuditFilter, h as AuditEntry, i as AuditExportOptions } from '../types-fHHAt3tt.js';
1
+ import { D as Database, k as AuditFilter, l as AuditEntry, m as AuditExportOptions } from '../types-Xk83hv4O.js';
2
2
  import 'drizzle-orm/better-sqlite3';
3
3
  import 'drizzle-orm/sqlite-core';
4
- import '../types-C5htunW6.js';
4
+ import '../types-mwupB57A.js';
5
5
  import 'zod';
6
6
 
7
7
  interface AuditModuleConfig {
@@ -14,6 +14,11 @@ interface AuditModuleConfig {
14
14
  declare function createAuditModule(config: AuditModuleConfig): {
15
15
  query: (filter: AuditFilter) => Promise<AuditEntry[]>;
16
16
  export: (options: AuditExportOptions) => Promise<string>;
17
+ cleanup: (options: {
18
+ retentionDays: number;
19
+ }) => Promise<{
20
+ deleted: number;
21
+ }>;
17
22
  };
18
23
 
19
24
  export { AuditEntry, AuditExportOptions, AuditFilter, createAuditModule };
@@ -1,5 +1,5 @@
1
- export { createAuditModule } from '../chunk-XW2X3O53.js';
2
- import '../chunk-XSYYQH75.js';
1
+ export { createAuditModule } from '../chunk-SJGSPIAD.js';
2
+ import '../chunk-V66UUIA7.js';
3
3
  import '../chunk-PZ5AY32C.js';
4
4
  //# sourceMappingURL=index.js.map
5
5
  //# sourceMappingURL=index.js.map