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 +69 -0
- package/dist/agent/index.d.ts +3 -3
- package/dist/agent/index.js +2 -2
- package/dist/audit/index.d.ts +7 -2
- package/dist/audit/index.js +2 -2
- package/dist/auth/index.d.ts +1859 -1
- package/dist/auth/index.js +3 -1
- package/dist/{chunk-DTCKF26N.js → chunk-5DT4DN4Y.js} +9 -3
- package/dist/chunk-5DT4DN4Y.js.map +1 -0
- package/dist/chunk-KL6XW4S4.js +10774 -0
- package/dist/chunk-KL6XW4S4.js.map +1 -0
- package/dist/{chunk-D2LJLY7F.js → chunk-OVGNZ5OX.js} +48 -4
- package/dist/chunk-OVGNZ5OX.js.map +1 -0
- package/dist/{chunk-XW2X3O53.js → chunk-SJGSPIAD.js} +14 -5
- package/dist/chunk-SJGSPIAD.js.map +1 -0
- package/dist/chunk-V66UUIA7.js +480 -0
- package/dist/chunk-V66UUIA7.js.map +1 -0
- package/dist/index.d.ts +1182 -12
- package/dist/index.js +3192 -121
- package/dist/index.js.map +1 -1
- package/dist/mcp/index.d.ts +55 -3
- package/dist/mcp/index.js +341 -134
- package/dist/mcp/index.js.map +1 -1
- package/dist/permission/index.d.ts +3 -3
- package/dist/permission/index.js +2 -2
- package/dist/types-Xk83hv4O.d.ts +7759 -0
- package/dist/{types-C5htunW6.d.ts → types-mwupB57A.d.ts} +56 -5
- package/package.json +1 -1
- package/dist/chunk-D2LJLY7F.js.map +0 -1
- package/dist/chunk-DTCKF26N.js.map +0 -1
- package/dist/chunk-XSYYQH75.js +0 -153
- package/dist/chunk-XSYYQH75.js.map +0 -1
- package/dist/chunk-XW2X3O53.js.map +0 -1
- package/dist/types-fHHAt3tt.d.ts +0 -2127
package/README.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# kavachos
|
|
2
|
+
|
|
3
|
+
Auth OS for AI agents. Identity, permissions, delegation, and audit.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/kavachos)
|
|
6
|
+
[](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
|
package/dist/agent/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { D as Database, C as CreateAgentInput,
|
|
2
|
-
export {
|
|
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-
|
|
5
|
+
import '../types-mwupB57A.js';
|
|
6
6
|
import 'zod';
|
|
7
7
|
|
|
8
8
|
interface AgentModuleConfig {
|
package/dist/agent/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { createAgentModule } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
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
|
package/dist/audit/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { D as Database,
|
|
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-
|
|
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 };
|
package/dist/audit/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { createAuditModule } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
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
|