@agentix-security/nextjs 0.1.9 → 0.1.10
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/dist/index.cjs +10 -2
- package/dist/index.js +10 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -534,7 +534,8 @@ function agentixMiddleware(sdk) {
|
|
|
534
534
|
});
|
|
535
535
|
}
|
|
536
536
|
const isHumanPage = !pathname.startsWith("/api/") && !pathname.startsWith("/agent/") && !pathname.startsWith("/_next/") && !pathname.startsWith("/favicon");
|
|
537
|
-
|
|
537
|
+
const score = agentScore(req);
|
|
538
|
+
if (isHumanPage && score >= 0.5) {
|
|
538
539
|
const registry = sdk.getIntentRegistry();
|
|
539
540
|
const tools = Object.fromEntries(
|
|
540
541
|
[...registry.entries()].map(([intent, entry]) => [intent, { routes: [...entry.routes] }])
|
|
@@ -545,7 +546,14 @@ function agentixMiddleware(sdk) {
|
|
|
545
546
|
token_id: null,
|
|
546
547
|
decision: "allow",
|
|
547
548
|
decision_reason: "agent_redirected_to_lane",
|
|
548
|
-
policy_id: "agent-detection"
|
|
549
|
+
policy_id: "agent-detection",
|
|
550
|
+
metadata: {
|
|
551
|
+
user_agent: req.headers.get("user-agent") ?? "",
|
|
552
|
+
agent_score: score,
|
|
553
|
+
has_sec_fetch: !!req.headers.get("sec-fetch-site"),
|
|
554
|
+
has_sec_ch_ua: !!req.headers.get("sec-ch-ua"),
|
|
555
|
+
accept: req.headers.get("accept") ?? ""
|
|
556
|
+
}
|
|
549
557
|
}));
|
|
550
558
|
return server_js.NextResponse.json({
|
|
551
559
|
service: "agentix-intent-sdk",
|
package/dist/index.js
CHANGED
|
@@ -532,7 +532,8 @@ function agentixMiddleware(sdk) {
|
|
|
532
532
|
});
|
|
533
533
|
}
|
|
534
534
|
const isHumanPage = !pathname.startsWith("/api/") && !pathname.startsWith("/agent/") && !pathname.startsWith("/_next/") && !pathname.startsWith("/favicon");
|
|
535
|
-
|
|
535
|
+
const score = agentScore(req);
|
|
536
|
+
if (isHumanPage && score >= 0.5) {
|
|
536
537
|
const registry = sdk.getIntentRegistry();
|
|
537
538
|
const tools = Object.fromEntries(
|
|
538
539
|
[...registry.entries()].map(([intent, entry]) => [intent, { routes: [...entry.routes] }])
|
|
@@ -543,7 +544,14 @@ function agentixMiddleware(sdk) {
|
|
|
543
544
|
token_id: null,
|
|
544
545
|
decision: "allow",
|
|
545
546
|
decision_reason: "agent_redirected_to_lane",
|
|
546
|
-
policy_id: "agent-detection"
|
|
547
|
+
policy_id: "agent-detection",
|
|
548
|
+
metadata: {
|
|
549
|
+
user_agent: req.headers.get("user-agent") ?? "",
|
|
550
|
+
agent_score: score,
|
|
551
|
+
has_sec_fetch: !!req.headers.get("sec-fetch-site"),
|
|
552
|
+
has_sec_ch_ua: !!req.headers.get("sec-ch-ua"),
|
|
553
|
+
accept: req.headers.get("accept") ?? ""
|
|
554
|
+
}
|
|
547
555
|
}));
|
|
548
556
|
return NextResponse.json({
|
|
549
557
|
service: "agentix-intent-sdk",
|