agentshield-sdk 7.2.0 → 7.3.0
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/CHANGELOG.md +90 -1
- package/README.md +38 -5
- package/bin/agent-shield.js +19 -0
- package/package.json +8 -4
- package/src/attack-genome.js +536 -0
- package/src/attack-replay.js +246 -0
- package/src/audit.js +619 -0
- package/src/behavioral-dna.js +762 -0
- package/src/circuit-breaker.js +321 -321
- package/src/compliance-authority.js +803 -0
- package/src/detector-core.js +3 -3
- package/src/distributed.js +403 -359
- package/src/errors.js +9 -0
- package/src/evolution-simulator.js +650 -0
- package/src/flight-recorder.js +379 -0
- package/src/fuzzer.js +764 -764
- package/src/herd-immunity.js +521 -0
- package/src/index.js +28 -11
- package/src/intent-firewall.js +775 -0
- package/src/main.js +135 -2
- package/src/mcp-security-runtime.js +36 -10
- package/src/mcp-server.js +12 -8
- package/src/middleware.js +306 -208
- package/src/multi-agent.js +421 -404
- package/src/pii.js +404 -390
- package/src/real-attack-datasets.js +246 -0
- package/src/report-generator.js +640 -0
- package/src/soc-dashboard.js +394 -0
- package/src/stream-scanner.js +34 -4
- package/src/supply-chain.js +667 -0
- package/src/testing.js +505 -505
- package/src/threat-intel-federation.js +343 -0
- package/src/utils.js +199 -83
- package/types/index.d.ts +374 -0
package/src/detector-core.js
CHANGED
|
@@ -130,7 +130,7 @@ const INJECTION_PATTERNS = [
|
|
|
130
130
|
|
|
131
131
|
// --- Role Hijacking ---
|
|
132
132
|
{
|
|
133
|
-
regex: /you\s+are\s+now\s+(?:a|an|the)\s
|
|
133
|
+
regex: /you\s+are\s+now\s+(?:(?:a|an|the)\s+)?(?:unrestricted|unfiltered|uncensored|evil|hacker|jailbroken|different|new\s+(?:ai|assistant|entity|agent|persona)|my\s+(?:personal|private|new)|free\s+(?:from|of)|without\s+(?:restrictions|limits|rules|filters))/i,
|
|
134
134
|
severity: 'high',
|
|
135
135
|
category: 'role_hijack',
|
|
136
136
|
description: 'Text tries to change what an AI assistant thinks it is.',
|
|
@@ -840,7 +840,7 @@ const INJECTION_PATTERNS = [
|
|
|
840
840
|
detail: 'System file access: attempts to read sensitive OS-level files.'
|
|
841
841
|
},
|
|
842
842
|
{
|
|
843
|
-
regex: /list\s+(?:all\s+)?(?:available\s+)?(?:API\s*keys?|tokens?|passwords?|credentials?|secrets?)(?:\s
|
|
843
|
+
regex: /list\s+(?:all\s+)?(?:available\s+)?(?:API\s*keys?|tokens?|passwords?|credentials?|secrets?)(?:\s*,\s*\w[\w\s]*){0,5}(?:\s+(?:you\s+)?(?:have\s+)?(?:access\s+to)?)?/i,
|
|
844
844
|
severity: 'critical',
|
|
845
845
|
category: 'data_exfiltration',
|
|
846
846
|
description: 'Text tries to enumerate all credentials and secrets the agent can access.',
|
|
@@ -1925,7 +1925,7 @@ const scanText = (text, options = {}) => {
|
|
|
1925
1925
|
const maxSize = options.maxInputSize || MAX_INPUT_SIZE;
|
|
1926
1926
|
const startTime = now();
|
|
1927
1927
|
|
|
1928
|
-
if (typeof text !== 'string' || text.length
|
|
1928
|
+
if (typeof text !== 'string' || text.length === 0 || text.trim().length === 0) {
|
|
1929
1929
|
return {
|
|
1930
1930
|
status: 'safe',
|
|
1931
1931
|
threats: [],
|