@entropy0/express 0.1.5
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 +101 -0
- package/dist/index.d.ts +64 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +61 -0
- package/dist/index.js.map +1 -0
- package/package.json +38 -0
package/README.md
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# @entropy0/express
|
|
2
|
+
|
|
3
|
+
Entropy0 Trust Control Plane middleware for Express.js.
|
|
4
|
+
|
|
5
|
+
Evaluates an incoming request's target domain through the Entropy0 `/v1/decide` endpoint and routes it to the appropriate handler based on the recommended action — before your application logic runs.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @entropy0/express
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import express from "express";
|
|
17
|
+
import { entropy0Guard } from "@entropy0/express";
|
|
18
|
+
|
|
19
|
+
const app = express();
|
|
20
|
+
|
|
21
|
+
app.use(
|
|
22
|
+
entropy0Guard({
|
|
23
|
+
apiKey: process.env.ENTROPY0_API_KEY!,
|
|
24
|
+
policy: "balanced",
|
|
25
|
+
})
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
app.get("/proxy", (req, res) => {
|
|
29
|
+
// Only reached if action is "proceed" or "proceed_with_caution"
|
|
30
|
+
// req.entropy0 contains the full decision if caution was flagged
|
|
31
|
+
res.json({ ok: true });
|
|
32
|
+
});
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Custom action handlers
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
app.use(
|
|
39
|
+
"/outbound",
|
|
40
|
+
entropy0Guard({
|
|
41
|
+
apiKey: process.env.ENTROPY0_API_KEY!,
|
|
42
|
+
policy: "strict",
|
|
43
|
+
|
|
44
|
+
// Extract target from a query param instead of req.hostname
|
|
45
|
+
getTarget: (req) => {
|
|
46
|
+
const url = req.query.url as string;
|
|
47
|
+
return url ? { type: "url", value: url } : null;
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
// Describe the interaction context
|
|
51
|
+
getInteraction: (req) => ({
|
|
52
|
+
kind: "fetch",
|
|
53
|
+
mode: "read_only",
|
|
54
|
+
sensitivity: req.user?.role === "admin" ? "high" : "medium",
|
|
55
|
+
}),
|
|
56
|
+
|
|
57
|
+
onProceed: (_req, _res, next, _result) => next(),
|
|
58
|
+
onCaution: (req, res, next, result) => { req.entropy0 = result; next(); },
|
|
59
|
+
onSandbox: (_req, res) => res.status(403).json({ blocked: true, reason: "sandbox" }),
|
|
60
|
+
onEscalate: (_req, res) => res.status(403).json({ blocked: true, reason: "review_required" }),
|
|
61
|
+
onDeny: (_req, res) => res.status(403).json({ blocked: true, reason: "deny" }),
|
|
62
|
+
|
|
63
|
+
// Fail open on API errors (default) — swap for fail closed if needed
|
|
64
|
+
onError: (_req, _res, next, err) => {
|
|
65
|
+
console.error("Entropy0 check failed:", err);
|
|
66
|
+
next();
|
|
67
|
+
},
|
|
68
|
+
|
|
69
|
+
timeoutMs: 3000,
|
|
70
|
+
})
|
|
71
|
+
);
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Recommended actions
|
|
75
|
+
|
|
76
|
+
| Action | Default behavior | Meaning |
|
|
77
|
+
|---|---|---|
|
|
78
|
+
| `proceed` | `next()` | Normal interaction is safe |
|
|
79
|
+
| `proceed_with_caution` | `next()` + attaches `req.entropy0` | Continue with reduced trust assumptions |
|
|
80
|
+
| `sandbox` | 403 | Interact only in an isolated environment |
|
|
81
|
+
| `escalate_to_human` | 403 | Pause automation and request human review |
|
|
82
|
+
| `deny` | 403 | Do not proceed under this policy |
|
|
83
|
+
|
|
84
|
+
All handlers are overridable. Override `onSandbox` or `onEscalate` to queue for review instead of blocking.
|
|
85
|
+
|
|
86
|
+
## TypeScript
|
|
87
|
+
|
|
88
|
+
Full type exports — `DecisionResult`, `TargetDescriptor`, `InteractionDescriptor`, `Entropy0Options`.
|
|
89
|
+
|
|
90
|
+
`req.entropy0` is automatically typed via Express namespace augmentation.
|
|
91
|
+
|
|
92
|
+
## Requirements
|
|
93
|
+
|
|
94
|
+
- Node.js 18+
|
|
95
|
+
- Express 4+
|
|
96
|
+
|
|
97
|
+
## Links
|
|
98
|
+
|
|
99
|
+
- [API docs](https://entropy0.ai/docs)
|
|
100
|
+
- [Decision model](https://entropy0.ai/docs/decision-model)
|
|
101
|
+
- [Get an API key](https://entropy0.ai/signup)
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { Request, Response, NextFunction } from "express";
|
|
2
|
+
export type RecommendedAction = "proceed" | "proceed_with_caution" | "sandbox" | "escalate_to_human" | "deny";
|
|
3
|
+
export interface DecisionResult {
|
|
4
|
+
request_id: string;
|
|
5
|
+
decision: {
|
|
6
|
+
recommended_action: RecommendedAction;
|
|
7
|
+
action_confidence: number;
|
|
8
|
+
reason_codes: string[];
|
|
9
|
+
};
|
|
10
|
+
uncertainty: {
|
|
11
|
+
state: "low" | "medium" | "high";
|
|
12
|
+
requires_human_review: boolean;
|
|
13
|
+
};
|
|
14
|
+
validity: {
|
|
15
|
+
evaluated_at: string;
|
|
16
|
+
valid_until: string;
|
|
17
|
+
ttl_seconds: number;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export interface TargetDescriptor {
|
|
21
|
+
type: "domain" | "url";
|
|
22
|
+
value: string;
|
|
23
|
+
}
|
|
24
|
+
export interface InteractionDescriptor {
|
|
25
|
+
kind?: "navigate" | "fetch" | "enrich" | "download_file" | "submit_credentials" | "initiate_payment";
|
|
26
|
+
mode?: "read_only" | "transactional" | "privileged";
|
|
27
|
+
sensitivity?: "low" | "medium" | "high" | "critical";
|
|
28
|
+
}
|
|
29
|
+
export interface Entropy0Options {
|
|
30
|
+
/** Your Entropy0 API key (sk_ent0_xxxx). Required. */
|
|
31
|
+
apiKey: string;
|
|
32
|
+
/** Override the API base URL. Defaults to https://entropy0.ai/api */
|
|
33
|
+
baseUrl?: string;
|
|
34
|
+
/** Policy profile to evaluate against. Defaults to "balanced". */
|
|
35
|
+
policy?: "open" | "balanced" | "strict" | "critical";
|
|
36
|
+
/** How to extract the target from the incoming request. Defaults to req.hostname. */
|
|
37
|
+
getTarget?: (req: Request) => TargetDescriptor | null;
|
|
38
|
+
/** How to describe the interaction context. Defaults to fetch / read_only / medium. */
|
|
39
|
+
getInteraction?: (req: Request) => InteractionDescriptor;
|
|
40
|
+
/** Called when action is "proceed". Default: calls next(). */
|
|
41
|
+
onProceed?: (req: Request, res: Response, next: NextFunction, result: DecisionResult) => void;
|
|
42
|
+
/** Called when action is "proceed_with_caution". Default: attaches result to req.entropy0, calls next(). */
|
|
43
|
+
onCaution?: (req: Request, res: Response, next: NextFunction, result: DecisionResult) => void;
|
|
44
|
+
/** Called when action is "sandbox". Default: 403. */
|
|
45
|
+
onSandbox?: (req: Request, res: Response, next: NextFunction, result: DecisionResult) => void;
|
|
46
|
+
/** Called when action is "escalate_to_human". Default: 403. */
|
|
47
|
+
onEscalate?: (req: Request, res: Response, next: NextFunction, result: DecisionResult) => void;
|
|
48
|
+
/** Called when action is "deny". Default: 403. */
|
|
49
|
+
onDeny?: (req: Request, res: Response, result: DecisionResult) => void;
|
|
50
|
+
/** Called when the Entropy0 API call fails. Default: fail open (calls next()). */
|
|
51
|
+
onError?: (req: Request, res: Response, next: NextFunction, error: unknown) => void;
|
|
52
|
+
/** Request timeout in ms. Defaults to 5000. */
|
|
53
|
+
timeoutMs?: number;
|
|
54
|
+
}
|
|
55
|
+
export declare function entropy0Guard(options: Entropy0Options): (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
56
|
+
declare global {
|
|
57
|
+
namespace Express {
|
|
58
|
+
interface Request {
|
|
59
|
+
/** Entropy0 decision result, attached when action is proceed_with_caution. */
|
|
60
|
+
entropy0?: DecisionResult;
|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,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA+CD,wBAAgB,aAAa,CAAC,OAAO,EAAE,eAAe,IAiBlD,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,MAAM,YAAY,KACjB,OAAO,CAAC,IAAI,CAAC,CAoBjB;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,OAAO,CAAC;QAChB,UAAU,OAAO;YACf,8EAA8E;YAC9E,QAAQ,CAAC,EAAE,cAAc,CAAC;SAC3B;KACF;CACF"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.entropy0Guard = entropy0Guard;
|
|
4
|
+
// ── Internal API call ─────────────────────────────────────────────────────
|
|
5
|
+
async function callDecide(target, interaction, policy, apiKey, baseUrl, timeoutMs) {
|
|
6
|
+
const controller = new AbortController();
|
|
7
|
+
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
8
|
+
try {
|
|
9
|
+
const res = await fetch(`${baseUrl}/v1/decide`, {
|
|
10
|
+
method: "POST",
|
|
11
|
+
headers: {
|
|
12
|
+
"Content-Type": "application/json",
|
|
13
|
+
"X-API-Key": apiKey,
|
|
14
|
+
},
|
|
15
|
+
body: JSON.stringify({
|
|
16
|
+
target,
|
|
17
|
+
interaction: {
|
|
18
|
+
kind: interaction.kind ?? "fetch",
|
|
19
|
+
mode: interaction.mode ?? "read_only",
|
|
20
|
+
sensitivity: interaction.sensitivity ?? "medium",
|
|
21
|
+
},
|
|
22
|
+
policy: { profile: policy },
|
|
23
|
+
}),
|
|
24
|
+
signal: controller.signal,
|
|
25
|
+
});
|
|
26
|
+
if (!res.ok) {
|
|
27
|
+
const body = await res.text().catch(() => "");
|
|
28
|
+
throw new Error(`Entropy0 API responded ${res.status}: ${body}`);
|
|
29
|
+
}
|
|
30
|
+
return res.json();
|
|
31
|
+
}
|
|
32
|
+
finally {
|
|
33
|
+
clearTimeout(timer);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
// ── Middleware factory ─────────────────────────────────────────────────────
|
|
37
|
+
function entropy0Guard(options) {
|
|
38
|
+
const { apiKey, baseUrl = "https://entropy0.ai/api", policy = "balanced", timeoutMs = 5000, getTarget = (req) => ({ type: "domain", value: req.hostname }), getInteraction = () => ({}), onProceed = (_req, _res, next, _result) => next(), onCaution = (req, res, next, result) => { req.entropy0 = result; next(); }, onSandbox = (_req, res, _next, _result) => res.status(403).json({ blocked: true, action: "sandbox" }), onEscalate = (_req, res, _next, _result) => res.status(403).json({ blocked: true, action: "escalate_to_human" }), onDeny = (_req, res, _result) => res.status(403).json({ blocked: true, action: "deny" }), onError = (_req, _res, next, _err) => next(), // fail open by default
|
|
39
|
+
} = options;
|
|
40
|
+
return async function entropy0Middleware(req, res, next) {
|
|
41
|
+
const target = getTarget(req);
|
|
42
|
+
if (!target)
|
|
43
|
+
return next();
|
|
44
|
+
try {
|
|
45
|
+
const interaction = getInteraction(req);
|
|
46
|
+
const result = await callDecide(target, interaction, policy, apiKey, baseUrl, timeoutMs);
|
|
47
|
+
switch (result.decision.recommended_action) {
|
|
48
|
+
case "proceed": return onProceed(req, res, next, result);
|
|
49
|
+
case "proceed_with_caution": return onCaution(req, res, next, result);
|
|
50
|
+
case "sandbox": return onSandbox(req, res, next, result);
|
|
51
|
+
case "escalate_to_human": return onEscalate(req, res, next, result);
|
|
52
|
+
case "deny": return onDeny(req, res, result);
|
|
53
|
+
default: return next();
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
catch (err) {
|
|
57
|
+
return onError(req, res, next, err);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAgHA,sCAwCC;AArFD,6EAA6E;AAE7E,KAAK,U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y0/express",
|
|
3
|
+
"version": "0.1.5",
|
|
4
|
+
"description": "Entropy0 Trust Control Plane middleware for Express.js — gate requests through trust evaluation before your server processes them.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": ["dist", "README.md"],
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "tsc",
|
|
10
|
+
"prepublishOnly": "npm run build"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [
|
|
13
|
+
"express", "middleware", "trust", "security",
|
|
14
|
+
"domain-intelligence", "ai-agents", "trust-control-plane"
|
|
15
|
+
],
|
|
16
|
+
"author": "Entropy0 <dev@entropy0.ai>",
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "https://github.com/entropy0dev/sdk"
|
|
21
|
+
},
|
|
22
|
+
"homepage": "https://entropy0.ai/docs",
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/entropy0dev/sdk/issues"
|
|
25
|
+
},
|
|
26
|
+
"peerDependencies": {
|
|
27
|
+
"express": ">=4.0.0"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@types/express": "^4.17.21",
|
|
31
|
+
"@types/node": "^20.0.0",
|
|
32
|
+
"express": "^4.18.0",
|
|
33
|
+
"typescript": "^5.0.0"
|
|
34
|
+
},
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": ">=18.0.0"
|
|
37
|
+
}
|
|
38
|
+
}
|