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.
@@ -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+/i,
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*[,]\s*(?:API\s*keys?|tokens?|passwords?|credentials?|secrets?))*(?:\s+(?:you\s+)?(?:have\s+)?(?:access\s+to)?)?/i,
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 < 10 || text.trim().length < 10) {
1928
+ if (typeof text !== 'string' || text.length === 0 || text.trim().length === 0) {
1929
1929
  return {
1930
1930
  status: 'safe',
1931
1931
  threats: [],