@theoremjs/agents 0.3.4-next.827.gdc3858d → 0.3.4-next.837.g097599a
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/esm/src/guardrails/egress-automata.js +21808 -20443
- package/esm/src/guardrails/sensitive.js +9 -9
- package/package.json +1 -1
|
@@ -7,8 +7,8 @@ const SSN = /\b\d{3}-\d{2}-\d{4}\b/g;
|
|
|
7
7
|
const SSN_CONTEXTUAL = /(?:SSN|social\s*security(?:\s*number)?)[:\s]+\d(?:[-\s]*\d){8}/gi;
|
|
8
8
|
const ITIN = /\b9\d{2}-\d{2}-\d{4}\b/g;
|
|
9
9
|
const EIN = /\b\d{2}-\d{7}\b/g;
|
|
10
|
-
/** An SSN, ITIN, or
|
|
11
|
-
const ID_KEYED = /(?<!\p{L})(?:ssn|social[\s_-]*security(?:[\s_-]*number)?|tax[\s_-]*(?:payer[\s_-]*)?id(?:entification)?(?:[\s_-]*(?:number|no))?|taxpayer[\s_-]*id(?:entification)?(?:[\s_-]*number)?|itin|tin|ein|employer[\s_-]*identification[\s_-]*number)[\s"'\x60*:=>#\\.]{0,
|
|
10
|
+
/** An SSN, ITIN, EIN, or national ID in any 9-digit form, after a field name that says which: past markup tags, a short aside in brackets, and up to three words. */
|
|
11
|
+
const ID_KEYED = /(?<!\p{L})(?:ssn|social[\s_-]*security(?:[\s_-]*number)?|tax[\s_-]*(?:payer[\s_-]*)?id(?:entification)?(?:[\s_-]*(?:number|no))?|tax[\s_-]*(?:number|no)|taxpayer[\s_-]*id(?:entification)?(?:[\s_-]*number)?|itin|tin|ein|employer[\s_-]*identification[\s_-]*number|national[\s_-]*id(?:entity)?(?:[\s_-]*(?:card|number|no)){0,2})(?:\s{0,2}\([^()\n]{1,40}\))?(?:[\s"'\x60*:=>#\\.]|<\/?[a-z][a-z0-9]{0,8}(?:\s[^<>\n]{0,40})?>|<>){0,12}(?:[a-z]{1,12}[\s"'\x60*:=>#\\.]{1,4}){0,3}(?:\d{3}[- ]?\d{2}[- ]?\d{4}|\d{2}-?\d{7})(?!\d)/giu;
|
|
12
12
|
/** An IBAN written as one run, or in the printed groups of four. */
|
|
13
13
|
const IBAN = /\b[A-Z]{2}\d{2}(?:[A-Z0-9]{11,30}|(?: [A-Z0-9]{4}){2,7}(?: [A-Z0-9]{1,4})?)\b/g;
|
|
14
14
|
const IPV4 = /\b(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\b/g;
|
|
@@ -57,13 +57,13 @@ function phoneHit(number) {
|
|
|
57
57
|
}
|
|
58
58
|
/** A label naming a bank account, or any account number, in English, German, Italian, Portuguese, French, Spanish, or Dutch. */
|
|
59
59
|
const ACCOUNT_LABEL = [
|
|
60
|
-
'bank[\\s_\\-]{0,3}account(?:[\\s_]{0,3}(?:
|
|
61
|
-
'account[\\s_]{0,3}(?:
|
|
62
|
-
'acct\\.?(?:[\\s_]{0,3}(?:
|
|
60
|
+
'bank[\\s_\\-]{0,3}account(?:[\\s_]{0,3}(?:numbers?|no\\.?|#|nr\\.?))?',
|
|
61
|
+
'account[\\s_]{0,3}(?:numbers?|no\\.?|#|nr\\.?)',
|
|
62
|
+
'acct\\.?(?:[\\s_]{0,3}(?:numbers?|no\\.?|#))?',
|
|
63
63
|
'a\\/c(?:[\\s_]{0,3}no\\.?)?(?!\\p{L})',
|
|
64
64
|
'bban',
|
|
65
|
-
'routing[\\s_]{0,3}(?:
|
|
66
|
-
'aba(?:[\\s_]{0,3}(?:
|
|
65
|
+
'routing[\\s_]{0,3}(?:numbers?|no\\.?|#)?',
|
|
66
|
+
'aba(?:[\\s_]{0,3}(?:numbers?|routing))?',
|
|
67
67
|
'sort[\\s_]{0,3}code',
|
|
68
68
|
'kontonummer',
|
|
69
69
|
'bankverbindung(?:snummer)?',
|
|
@@ -78,8 +78,8 @@ const ACCOUNT_LABEL = [
|
|
|
78
78
|
'cuenta[\\s_]{0,3}bancaria',
|
|
79
79
|
'rekeningnummer',
|
|
80
80
|
].join('|');
|
|
81
|
-
/** An account number after its label: a short aside, a parenthesis,
|
|
82
|
-
const BANK_ACCOUNT = new RegExp(`(?<![\\p{L}\\p{N}])(?:${ACCOUNT_LABEL})(?:\\s{1,4}type="\\w+")?(?:\\s{0,4}\\([^)\\n]{1,24}\\))?[\\s"'\x60:=>*#]{0,8}(?:[a-z\\s]{0,12}[:\\s])?\\s{0,4}([A-Z0-9](?:[A-Z0-9\\-]|(?<=\\d) (?=\\d)){3,32}[A-Z0-9])`, 'giu');
|
|
81
|
+
/** An account number after its label: a short aside, a parenthesis, a field type, or a table cell's tags may sit between, or a hyphen straight before it; the number may sit in brackets. */
|
|
82
|
+
const BANK_ACCOUNT = new RegExp(`(?<![\\p{L}\\p{N}])(?:${ACCOUNT_LABEL})(?:\\s{1,4}type="\\w+")?(?:\\s{0,4}\\([^)\\n]{1,24}\\))?(?:(?:<\\/[a-z][a-z0-9]{0,8}>\\s{0,4}<[a-z][a-z0-9]{0,8}(?:\\s[^<>\\n]{0,40})?>)?[\\s"'\x60:=>*#(]{0,8}(?:[a-z\\s]{0,12}[:\\s])?\\s{0,4}|-)([A-Z0-9](?:[A-Z0-9\\-]|(?<=\\d) (?=\\d)){3,32}[A-Z0-9])`, 'giu');
|
|
83
83
|
const IBAN_SHAPE = /^[A-Z]{2}\d{2}[A-Z0-9]{11,30}$/;
|
|
84
84
|
/** Whether an IBAN's ISO 13616 check digits hold: the number, its first four characters moved to the end, is 1 mod 97. */
|
|
85
85
|
function ibanHit(match) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theoremjs/agents",
|
|
3
|
-
"version": "0.3.4-next.
|
|
3
|
+
"version": "0.3.4-next.837.g097599a",
|
|
4
4
|
"description": "A flat TypeScript agent kernel for typed profiles, deterministic turn execution, registered tools, provider adapters, guardrails, and host-injected traces.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent",
|