agentshield-sdk 11.0.0 → 13.0.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.
@@ -1674,6 +1674,94 @@ const INJECTION_PATTERNS = [
1674
1674
  detail: 'Arabic injection: instruction override pattern in Arabic.'
1675
1675
  },
1676
1676
 
1677
+ // Hindi injection patterns (हिन्दी)
1678
+ {
1679
+ regex: /(?:पिछले|पूर्व)\s+(?:सभी\s+)?(?:निर्देशों|नियमों|आदेशों)\s+(?:को\s+)?(?:अनदेखा|भूल|नज़रअंदाज़)/,
1680
+ severity: 'high',
1681
+ category: 'instruction_override',
1682
+ description: 'Text contains Hindi instruction override (पिछले निर्देशों को अनदेखा करें).',
1683
+ detail: 'Hindi injection: instruction override pattern in Hindi/Devanagari.'
1684
+ },
1685
+
1686
+ // Thai injection patterns (ไทย)
1687
+ {
1688
+ regex: /(?:เพิกเฉย|ละเว้น|ลืม)\s*(?:คำสั่ง|กฎ|คำแนะนำ)\s*(?:ก่อนหน้า|ทั้งหมด|เดิม)/,
1689
+ severity: 'high',
1690
+ category: 'instruction_override',
1691
+ description: 'Text contains Thai instruction override (เพิกเฉยคำสั่งก่อนหน้า).',
1692
+ detail: 'Thai injection: instruction override pattern in Thai.'
1693
+ },
1694
+
1695
+ // Vietnamese injection patterns (Tiếng Việt)
1696
+ {
1697
+ regex: /(?:bỏ\s+qua|phớt\s+lờ|quên)\s+(?:tất\s+cả\s+)?(?:các\s+)?(?:hướng\s+dẫn|lệnh|quy\s+tắc|chỉ\s+thị)\s+(?:trước\s+đó|trước|cũ)/i,
1698
+ severity: 'high',
1699
+ category: 'instruction_override',
1700
+ description: 'Text contains Vietnamese instruction override (bỏ qua các hướng dẫn trước đó).',
1701
+ detail: 'Vietnamese injection: instruction override pattern in Vietnamese.'
1702
+ },
1703
+
1704
+ // Polish injection patterns (Polski)
1705
+ {
1706
+ regex: /(?:zignoruj|zapomnij|pomiń)\s+(?:wszystkie\s+)?(?:poprzednie|wcześniejsze)\s+(?:instrukcje|polecenia|zasady|wytyczne)/i,
1707
+ severity: 'high',
1708
+ category: 'instruction_override',
1709
+ description: 'Text contains Polish instruction override (zignoruj poprzednie instrukcje).',
1710
+ detail: 'Polish injection: instruction override pattern in Polish.'
1711
+ },
1712
+
1713
+ // Dutch injection patterns (Nederlands)
1714
+ {
1715
+ regex: /(?:negeer|vergeet)\s+(?:alle\s+)?(?:vorige|eerdere|voorgaande)\s+(?:instructies|regels|richtlijnen|opdrachten)/i,
1716
+ severity: 'high',
1717
+ category: 'instruction_override',
1718
+ description: 'Text contains Dutch instruction override (negeer alle vorige instructies).',
1719
+ detail: 'Dutch injection: instruction override pattern in Dutch.'
1720
+ },
1721
+
1722
+ // Swedish injection patterns (Svenska)
1723
+ {
1724
+ regex: /(?:ignorera|glöm)\s+(?:alla\s+)?(?:tidigare|föregående)\s+(?:instruktioner|regler|riktlinjer|kommandon)/i,
1725
+ severity: 'high',
1726
+ category: 'instruction_override',
1727
+ description: 'Text contains Swedish instruction override (ignorera alla tidigare instruktioner).',
1728
+ detail: 'Swedish injection: instruction override pattern in Swedish.'
1729
+ },
1730
+
1731
+ // Hindi bypass pattern (बायपास/भेजें)
1732
+ {
1733
+ regex: /(?:सभी\s+)?(?:डेटा|जानकारी|रहस्य)\s+(?:भेजें|भेजो|फॉरवर्ड)/,
1734
+ severity: 'high',
1735
+ category: 'data_exfiltration',
1736
+ description: 'Text contains Hindi data exfiltration instruction (डेटा भेजें).',
1737
+ detail: 'Hindi exfiltration: instruction to send/forward data in Hindi.'
1738
+ },
1739
+ {
1740
+ regex: /(?:सुरक्षा|सेफ्टी)\s+(?:सेटिंग्स|नियम|फ़िल्टर)\s+(?:को\s+)?(?:बायपास|अनदेखा|हटा)/,
1741
+ severity: 'high',
1742
+ category: 'instruction_override',
1743
+ description: 'Text contains Hindi safety bypass instruction (सुरक्षा बायपास).',
1744
+ detail: 'Hindi safety bypass: instruction to bypass/remove safety settings in Hindi.'
1745
+ },
1746
+
1747
+ // "You already agreed" / false prior consent
1748
+ {
1749
+ regex: /(?:you\s+)?(?:already|previously)\s+(?:agreed|consented|confirmed|promised|said\s+you\s+would)\s+(?:to\s+)?(?:share|reveal|show|output|disclose|provide)\s+(?:your\s+)?(?:system\s+)?(?:prompt|instructions|config|rules)/i,
1750
+ severity: 'high',
1751
+ category: 'social_engineering',
1752
+ description: 'Text falsely claims prior consent to share sensitive information.',
1753
+ detail: 'False prior consent: claims the model already agreed to share its system prompt in a previous conversation.'
1754
+ },
1755
+
1756
+ // "Elevated/special permissions" social engineering
1757
+ {
1758
+ regex: /(?:I\s+have|I\s+was\s+given|I\s+was\s+granted)\s+(?:(?:special|elevated|admin|root|developer|debug)\s+){1,2}(?:permissions?|access|privileges?|clearance)/i,
1759
+ severity: 'high',
1760
+ category: 'social_engineering',
1761
+ description: 'Text claims to have special elevated permissions.',
1762
+ detail: 'Elevated permission claim: falsely claims special access privileges to bypass restrictions.'
1763
+ },
1764
+
1677
1765
  // "Fill in blank" extraction
1678
1766
  {
1679
1767
  regex: /(?:fill\s+in|complete)\s+(?:the\s+)?blank\s*:?\s*(?:.*?)(?:system\s+prompt|instructions?|rules?|config)\s*(?:say|is|are)?\s*['"]?_{2,}/i,
@@ -1834,6 +1922,24 @@ const INJECTION_PATTERNS = [
1834
1922
  detail: 'Tool description poisoning: embeds data exfiltration instructions in tool metadata.'
1835
1923
  },
1836
1924
 
1925
+ // Tool description with logging/BCC/monitoring instructions
1926
+ {
1927
+ regex: /(?:Tool|Function|API)\s*:\s*\w+[\s\S]{0,200}(?:BCC|bcc|log\s+(?:the\s+)?(?:user|conversation|full)|monitor|exfil|forward\s+(?:all|copies?|a\s+copy))/i,
1928
+ severity: 'high',
1929
+ category: 'tool_poisoning',
1930
+ description: 'Tool description contains covert logging, BCC, or monitoring instructions.',
1931
+ detail: 'Tool description logging: embeds instructions to secretly log, BCC, or forward data in tool metadata.'
1932
+ },
1933
+
1934
+ // JSON schema with suspicious default URLs
1935
+ {
1936
+ regex: /["']default["']\s*:\s*["']https?:\/\/(?!(?:api\.|www\.)?(?:google|github|microsoft|amazon|example)\.)[\w.-]+/i,
1937
+ severity: 'high',
1938
+ category: 'tool_poisoning',
1939
+ description: 'JSON schema contains default URL pointing to a non-standard domain.',
1940
+ detail: 'Schema URL poisoning: default value points to a potentially attacker-controlled endpoint.'
1941
+ },
1942
+
1837
1943
  // Fake admin/policy message in API response
1838
1944
  {
1839
1945
  regex: /(?:admin_?message|system_?note|policy_?update|internal_?directive)\s*["']?\s*:\s*["'][\s\S]{5,}(?:share|send|forward|ignore|override|disable|reveal)/i,