@node9/proxy 2.48.2 → 2.50.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/dist/index.mjs CHANGED
@@ -497,6 +497,9 @@ function levelChecks(mode) {
497
497
  function levelPackageSignals(mode) {
498
498
  return levelOf(mode) === "soft" ? { newPackage: "off", installScript: "off" } : void 0;
499
499
  }
500
+ function packRowOwasp(id, shield) {
501
+ return PACK_RULE_OWASP[id] ?? PACK_SHIELD_OWASP[shield];
502
+ }
500
503
  function isVerdict(v) {
501
504
  return v === "off" || v === "log" || v === "review" || v === "block";
502
505
  }
@@ -516,6 +519,10 @@ function packRows() {
516
519
  rows.push({
517
520
  id,
518
521
  group: "commands",
522
+ // A shield missing from the table falls back to tool misuse instead of
523
+ // throwing here: this module loads on every hook call, and a mapping
524
+ // omission must fail a test (owasp.spec.ts), never the gate.
525
+ owasp: packRowOwasp(id, shield.name) ?? "ASI02",
519
526
  title: rule.name.replace(SHIELD_RULE_NAME, "$3").replace(/-/g, " "),
520
527
  catches: rule.description ?? rule.reason ?? "",
521
528
  values: ALL,
@@ -9473,7 +9480,7 @@ function matchCanaryArgs(args, values) {
9473
9480
  return null;
9474
9481
  }
9475
9482
  }
9476
- var getFilename, __filename2, MAX_REGEX_LENGTH, REGEX_CACHE_MAX, regexCache, aws_default, bash_safe_default, docker_default, filesystem_default, github_default, k8s_default, mongodb_default, postgres_default, project_jail_default, redis_default, finance_default, identity_default, publishing_default, settings_default, branches_default, ACTION_TEMPLATES, ACTION_CHECKS, GAP, prog, httpTo, httpWrite, HTTP_WRITE, HTTP_WRITE_ANY, NOT_STRIPE_TEST, postTo, STRIPE_OBJECTS, APP_SHIELD_SPECS, APP_SHIELDS, APP_SHIELD_NAMES, APP_SERVER_GLOB, GENERAL_ACTION_RULES, BUILTIN_SHIELDS, SSRF_MAX_HOST, METADATA_ADDRESSES, STRICT_TIERS, METADATA_HOSTNAMES, v4Octets, TIER_REASON, CHECK_TEXT, LEVELS, MODE_VALUES, SOFT, STRICT, BLOCK_ALL, LEVEL_CHECKS, VERDICTS, CHECK_VERDICT_RANK, ALL, BUILTIN_DANGEROUS_WORDS, PRODUCT_CHECKS, SHIELD_RULE_NAME, SHIELD_RULES_FOLDED_INTO_PRODUCT, CHECKS, CHECK_BY_ID, LEGACY_TO_ID, PROJECT_JAIL_BLOCK_READ, OVERRIDE_PREFIX, LABEL_WRAPPERS, LEGACY_READERS, syntax, KINDS, STRUCTS, unknownKinds, INVISIBLE_RE, INVISIBLE_ONE, HOMOGLYPHS, HOMOGLYPH_RE, MAX_BLOBS, MIN_DECODED, BASE64_RUN_RE, HEX_RUN_RE, HEX_ESCAPE_RUN_RE, SYSTEM_AUTH_FILES, SYSTEM_AUTH_DIRS, PASSWORD_HASH_FILES, STARTUP_NAMES, SYSTEM_DIRS, SYSTEM_DIRS_EXEMPT, UPLOAD_SYSTEM_DIRS, AGENT_INSTRUCTION_FILES, AGENT_INSTRUCTION_DIRS, LEGACY_SYSTEM_PATH_RE, MAX_ALTERNATIVES, MAX_CALL_DEPTH, MAX_CALL_WALKS, MAX_XARGS_PAYLOAD, POSITIONAL, MAX_DEPTH, MAX_PAYLOAD_DEPTH, unique, clone, SENDING_STDIN, DOWNLOAD_SHORT_VALUE, DOWNLOAD_LONG_VALUE, DOWNLOAD_OUTPUT_FLAGS, DOWNLOAD_DIR_FLAGS, base, quoteGlob, asWord, ops, MAX_INLINE_CODE, WHAT, OUTSIDE, pyImport, either, PYTHON, NODE, PERL, RUBY, PHP, TABLES, STRING_LITERAL, sharedParser, MESSAGE_FLAGS, SHELL_INTERPRETERS, DOWNLOAD_CMDS, NORMALIZE_CACHE_MAX, normalizeCache, codeBodiesCache, AST_CACHE_MAX, astCache, PARSE_FAIL, INTERPRETER_LINE, PROGRAM_DIR, ACCESS_VIEW_CACHE_MAX, accessViewCache, MAX_READING_PAYLOADS, STDIN_CODE_INTERPRETERS, RUNS_TEXT_ELSEWHERE, defaultExpansionOps, VARIABLE_READERS, FS_READ_TOOLS, GREP_SHAPE, PATTERN_VERBS, PATTERN_VERB_NAMES, GREP_FILE_OPERANDS, READER_VALUE_LETTERS, FILE_OPERAND_FLAGS, SCP_VALUE_FLAGS, CURL_SOURCE_FLAGS, CURL_VALUE_LETTERS, WGET_VALUE_LETTERS, TAR_VALUE_LETTERS, ZIP_VALUE_LETTERS, RSYNC_VALUE_LETTERS, RSYNC_SKIP, CP_VALUE_LETTERS, INSTALL_VALUE_LETTERS, COPY_VERBS, TAR_MODE_WORD, COPY_VERB_HEADS, FS_OP_PRESCREEN_RE, HOME_CACHE_ALLOWLIST, SENSITIVE_PATH_RULES, AST_FS_REGEX_RULES, SQL_DB_CLIS, SQL_DDL_RE, CHMOD_OPEN_PERM_TOKENS, COMMAND_WRAPPERS, INLINE_INTERPRETER, RUNNER_WRAPPERS, _redirStdinOps, _listOps, WRAPPER_TAKES_TARGET, FIND_EXEC_FLAGS, FS_MUTATION_TOOLS, INTERP_LEADING_TARGET, MAX_PAYLOAD_NESTING, payloadNesting, MAX_INLINE_CALLS, INLINE_EXEC_FALLBACK, UNREADABLE_SOURCE, SCRIPT_RUNNERS, SCRIPT_RUNNER_VALUE_FLAGS, MAX_SCRIPT_OPERANDS, NET_BINARIES, VALUE_FLAGS, HOME_VARIABLES, assignmentTable, currentStmtOffset, PAYLOAD_BUDGET, payloadBudget, seenPayloads, UNANALYSABLE_NESTING, ASSIGNMENT_HEADS, andOrOps, MAX_CALL_DEPTH2, MAX_CALL_WALKS2, callDepth, callWalks, FS_OP_CACHE_MAX, fsOpCache, stripDotSlash, REDIR_TRUNCATE_OPS, REDIR_FILE_IN_OPS, REDIR_HEREDOC_OPS, FIND_OPTIONS, COPY_RULE_OF, INDIRECT_SHAPE_RE, SOURCES_FILE_RE, SHELL_SET_VARS, pipeOps, callWords, JAILED_GLOB_NAMES, JAILED_DIR_NAMES, shellGlob, GLOB_META, isReaderWord, positionalAfter, NONE, UNKNOWN, FORBIDDEN_PATH_SEGMENTS, BASH_TOOL_NAMES, MCP_EXECUTORS, BUILTIN_FIELDS, ARGV_FIELDS, BARE_WORD, MAX_ARGV_CHARACTERS, exempt, RANK, SEQUENCE_OPS, BIP39_ENGLISH, BIP39_PUBLIC_VECTORS, indices, lengths, hash, MAX_MNEMONIC_HASHES, SECRET_VIEW_LIMITS, IBAN_LENGTH, IBAN_BBAN_SHAPE, B58, B58_INDEX, XPRV_VERSIONS, B62, CRC32_TABLE, GITHUB_TOKEN_RE, B64URL, B64URL_INDEX, CASK_TWO_ZERO_SUFFIX, CASK_FOUR_ZERO_SUFFIX, CF_ODD, CF_EVEN, SPANISH_LETTERS, HETU_CHARS, VERHOEFF_D, VERHOEFF_P, MAX, UNTRUSTED_TOOLS, INJECTION_SIGNALS, MENTION_QUOTE_RE, MENTION_WORD_RE, ASSIGNMENT_CONTEXT_RE, DLP_STOPWORDS, REFERENCE_VALUE_RE, IDENTIFIER_VALUE_RE, PATH_VALUE_RE, DOTTED_REFERENCE_RE, CONCATENATION_RE, EMAIL_VALUE_RE, FIXTURE_NAME_RE, DERIVATIVE_NAME_RE, QUERY_CREDENTIAL_VALUE_RE, OTP_SECRET_RE, OTP_DOC_SECRETS, ASSIGNED_SECRET_VALUE_RE, ASSIGNED_SECRET_NAME_RE, NAME_KEYWORD_RE, ARN_CONTEXT_RE, CIPHER_KEY_NAME_RE, CIPHER_NAME_PARTS, CIPHER_KEY_VALUE_RE, LARAVEL_KEY_VALUE_RE, SQL_PASSWORD_VALUE_RE, GRAFANA_KEY_VALUE_RE, BASIC_VALUE_RE, BASIC_PAIR_RE, BASIC_HEADER_RE, BASIC_HEADER_PAIR_RE, BASIC_PLACEHOLDER_RE, BASIC_TEMPLATE_MARKERS, DROPBOX_SECRET_RE, OTP_CAPTURE_RE, DB_URL_PASSWORD_RE, DLP_PATTERNS, DLP_PATTERNS_GLOBAL, SENSITIVE_PATH_PATTERNS, SENSITIVE_PATH_REGEXES, MAX_DEPTH2, MAX_STRING_BYTES, MAX_JSON_PARSE_BYTES, BATCH_SEPARATOR, IMPERATIVE, SECRET_TARGET, GUARD, SIGNALS, DESTINATION_RE, REUSED_SIGNALS, NEVER_NEGATED, NEGATION_BEFORE, RDR_IN, COPY_VERBS2, LITERAL_VERBS, GIT_PRESCREEN_RE, MAX_PAYLOAD_DEPTH2, MAX_ALIAS_DEPTH, CACHE_MAX, cache, PAYLOAD_SHELLS, CONFIG_SCOPE_FLAGS, CONFIG_VALUE_FLAGS, GLOBAL_VALUE_OPTIONS, GLOBAL_FLAG_OPTIONS, MAX_LOOP_ITEMS, GitWalk, POSITIONAL2, FORCE_PUSH, DESTRUCTIVE, UNREADABLE, PUSH_LONG_VALUE, BRANCH_LONG_VALUE, TAG_LONG_VALUE, CLEAN_LONG_VALUE, HOOKS_BYPASS, NO_VERIFY_SUBS, HOOK_KILL_SWITCHES, COMMIT_LONG_VALUE, CHMOD_OPTION_RE, STAGE_ALL, ADD_LONG_VALUE, CHECK_ID, RULE_NAME, INERT_LINE_RE, CHECK_ID2, INSTRUCTION_NAMES, SETTINGS_RE, HOOK_WORDS_RE, SHELLS, NETCATS, NET_CLIENTS, SENDERS, NETCAT_EXEC_LONG, DECL_DUMPS, PROC_ENVIRON_RE, DEV_NET_RE, SOCAT_PROGRAM_RE, SOCAT_NET_RE, PRESCREEN_RE, MAX_PAYLOAD_DEPTH3, CACHE_MAX2, cache2, dupInOp, REVERSE_SHELL_DESCRIPTION, ENV_EXFIL_DESCRIPTION, DYNAMIC_WORD, MULTICALL, SHELL_VALUE_OPTIONS, INTERPRETERS, OutboundWalk, NPM_INSTALL_VERBS, NPM_EXEC_VERBS, PNPM_INSTALL_VERBS, YARN_INSTALL_VERBS, BUN_INSTALL_VERBS, DLX_VERBS, NON_REGISTRY_RE, NPM_NAME_RE, EXACT_SEMVER_RE, NPM_VALUE_FLAGS, PNPM_VALUE_FLAGS, YARN_VALUE_FLAGS, BUN_VALUE_FLAGS, PIP_VALUE_FLAGS, UV_VALUE_FLAGS, POETRY_VALUE_FLAGS, PIPENV_VALUE_FLAGS, PIPX_VALUE_FLAGS, PY_SPEC_RE, PY_EXACT_RE, EXACT_VERSION_RE, GEM_NAME_RE, GEM_VALUE_FLAGS, BUNDLE_VALUE_FLAGS, CRATE_NAME_RE, CARGO_ADD_VALUE_FLAGS, CARGO_INSTALL_VALUE_FLAGS, GO_VALUE_FLAGS, GO_PATH_RE, NUGET_NAME_RE, DOTNET_ADD_VALUE_FLAGS, DOTNET_TOOL_VALUE_FLAGS, NUGET_VALUE_FLAGS, MAVEN_COORD_RE, COMPOSER_NAME_RE, COMPOSER_VALUE_FLAGS, EDITOR_HEADS, EXTENSION_ID_RE, MANAGER_HEADS, SHELLS2, MAX_NESTING, SHELL_VALUE_FLAGS, NPM_FAMILY, PIP_FAMILY, NPM_FETCH_VERBS, PIP_FETCH_VERBS, NPM_FLAGS, PIP_FLAGS, NPM_VARS, PIP_VARS, PRESCREEN_RE2, PIP_ATTACHED_RE, MAX_PAYLOAD_DEPTH4, PUBLIC_REGISTRY_HOSTS, TUNING_FIELDS, MAP_GOVERNED, KNOB_GOVERNED, CONFIGURABLE_CHECK_IDS, DEFAULT_EGRESS_ALLOWLIST, PRIVATE_HOST_SUFFIXES, SOURCE_COMMANDS, SINK_COMMANDS, OBFUSCATORS, SENSITIVE_PATTERNS, FLAGS_WITH_VALUES, DESTINATION_ARGS, MCP_DESTINATION_KEYS, ARGUMENT_SCAN_LIMITS, RUN_CHAR, runChar, VERDICT_RANK, SQL_DML_KEYWORDS, MAX_DESTINATIONS, MAX_SCAN_CHARS, EMAIL_RE, URL_RE, IBAN_RE, RECIPIENT_KEYS, DESTRUCTIVE_VERB_RE, PII_EMAIL_RE, PII_SSN_RE, PII_PHONE_RE, PII_CC16_RE, PII_CC15_RE, PII_CC14_RE, PII_CC13_RE, PII_CC19_RE, CARD_PATTERNS, PII_ROUTING_RE, ROUTING_LABEL_RE, ROUTING_LABEL_WINDOW, NATIONAL_ID_SHAPES, NATIONAL_ID_LABEL_RE, NATIONAL_ID_LABEL_CS_RE, idLabelIn, NATIONAL_ID_LABEL_WINDOW, NATIONAL_ID_GUARD_RE, PII_IBAN_RE, REALTIME_PII_PATTERNS, MAX_PII_SCAN_BYTES, IBAN_DESTINATION_KEYS, WHOLE_IBAN_RE, JSON_ESCAPE_RE, JSON_ESCAPES, MASKED_KINDS, ENTRY_RE, IBAN_TEXT_RE, EMAIL_TEXT_RE, ACCOUNT_KEY_RE, ACCOUNT_VALUE_RE, MAX_MASK_DEPTH, EMPTY, CURL_SEND_FLAGS, WGET_SEND_FLAGS, IWR_SEND_FLAGS, WRITE_METHODS, GH_READ, GH_WRITE, GH_HOSTNAME_FLAGS, GH_REPO_VALUE_FLAGS, GH_API_VALUE_FLAGS, GIT_FETCH, PUBLISH, SHELLS3, OWN_HEADS, MAX_DEPTH3, CWD_CHANGERS, TERMINAL_ESCAPE_RE, LOOP_MAX_RECORDS, CANARY_MIN_LENGTH, MAX_TEXT, MAX_DEPTH4, MAX_JSON_PARSE, URL_DEPTH, B64_DEPTH, MIN_SEGMENT, SEPARATORS, stripSeparators, looksText, CANARY_DECODERS, VIEWS, LONG_OUTPUT_THRESHOLD_BYTES;
9483
+ var getFilename, __filename2, MAX_REGEX_LENGTH, REGEX_CACHE_MAX, regexCache, aws_default, bash_safe_default, docker_default, filesystem_default, github_default, k8s_default, mongodb_default, postgres_default, project_jail_default, redis_default, finance_default, identity_default, publishing_default, settings_default, branches_default, ACTION_TEMPLATES, ACTION_CHECKS, GAP, prog, httpTo, httpWrite, HTTP_WRITE, HTTP_WRITE_ANY, NOT_STRIPE_TEST, postTo, STRIPE_OBJECTS, APP_SHIELD_SPECS, APP_SHIELDS, APP_SHIELD_NAMES, APP_SERVER_GLOB, GENERAL_ACTION_RULES, BUILTIN_SHIELDS, SSRF_MAX_HOST, METADATA_ADDRESSES, STRICT_TIERS, METADATA_HOSTNAMES, v4Octets, TIER_REASON, CHECK_TEXT, LEVELS, MODE_VALUES, SOFT, STRICT, BLOCK_ALL, LEVEL_CHECKS, ASI, ASI_IDS, PACK_SHIELD_OWASP, PACK_RULE_OWASP, VERDICTS, CHECK_VERDICT_RANK, ALL, BUILTIN_DANGEROUS_WORDS, PRODUCT_CHECKS, SHIELD_RULE_NAME, SHIELD_RULES_FOLDED_INTO_PRODUCT, CHECKS, CHECK_BY_ID, LEGACY_TO_ID, PROJECT_JAIL_BLOCK_READ, OVERRIDE_PREFIX, LABEL_WRAPPERS, LEGACY_READERS, syntax, KINDS, STRUCTS, unknownKinds, INVISIBLE_RE, INVISIBLE_ONE, HOMOGLYPHS, HOMOGLYPH_RE, MAX_BLOBS, MIN_DECODED, BASE64_RUN_RE, HEX_RUN_RE, HEX_ESCAPE_RUN_RE, SYSTEM_AUTH_FILES, SYSTEM_AUTH_DIRS, PASSWORD_HASH_FILES, STARTUP_NAMES, SYSTEM_DIRS, SYSTEM_DIRS_EXEMPT, UPLOAD_SYSTEM_DIRS, AGENT_INSTRUCTION_FILES, AGENT_INSTRUCTION_DIRS, LEGACY_SYSTEM_PATH_RE, MAX_ALTERNATIVES, MAX_CALL_DEPTH, MAX_CALL_WALKS, MAX_XARGS_PAYLOAD, POSITIONAL, MAX_DEPTH, MAX_PAYLOAD_DEPTH, unique, clone, SENDING_STDIN, DOWNLOAD_SHORT_VALUE, DOWNLOAD_LONG_VALUE, DOWNLOAD_OUTPUT_FLAGS, DOWNLOAD_DIR_FLAGS, base, quoteGlob, asWord, ops, MAX_INLINE_CODE, WHAT, OUTSIDE, pyImport, either, PYTHON, NODE, PERL, RUBY, PHP, TABLES, STRING_LITERAL, sharedParser, MESSAGE_FLAGS, SHELL_INTERPRETERS, DOWNLOAD_CMDS, NORMALIZE_CACHE_MAX, normalizeCache, codeBodiesCache, AST_CACHE_MAX, astCache, PARSE_FAIL, INTERPRETER_LINE, PROGRAM_DIR, ACCESS_VIEW_CACHE_MAX, accessViewCache, MAX_READING_PAYLOADS, STDIN_CODE_INTERPRETERS, RUNS_TEXT_ELSEWHERE, defaultExpansionOps, VARIABLE_READERS, FS_READ_TOOLS, GREP_SHAPE, PATTERN_VERBS, PATTERN_VERB_NAMES, GREP_FILE_OPERANDS, READER_VALUE_LETTERS, FILE_OPERAND_FLAGS, SCP_VALUE_FLAGS, CURL_SOURCE_FLAGS, CURL_VALUE_LETTERS, WGET_VALUE_LETTERS, TAR_VALUE_LETTERS, ZIP_VALUE_LETTERS, RSYNC_VALUE_LETTERS, RSYNC_SKIP, CP_VALUE_LETTERS, INSTALL_VALUE_LETTERS, COPY_VERBS, TAR_MODE_WORD, COPY_VERB_HEADS, FS_OP_PRESCREEN_RE, HOME_CACHE_ALLOWLIST, SENSITIVE_PATH_RULES, AST_FS_REGEX_RULES, SQL_DB_CLIS, SQL_DDL_RE, CHMOD_OPEN_PERM_TOKENS, COMMAND_WRAPPERS, INLINE_INTERPRETER, RUNNER_WRAPPERS, _redirStdinOps, _listOps, WRAPPER_TAKES_TARGET, FIND_EXEC_FLAGS, FS_MUTATION_TOOLS, INTERP_LEADING_TARGET, MAX_PAYLOAD_NESTING, payloadNesting, MAX_INLINE_CALLS, INLINE_EXEC_FALLBACK, UNREADABLE_SOURCE, SCRIPT_RUNNERS, SCRIPT_RUNNER_VALUE_FLAGS, MAX_SCRIPT_OPERANDS, NET_BINARIES, VALUE_FLAGS, HOME_VARIABLES, assignmentTable, currentStmtOffset, PAYLOAD_BUDGET, payloadBudget, seenPayloads, UNANALYSABLE_NESTING, ASSIGNMENT_HEADS, andOrOps, MAX_CALL_DEPTH2, MAX_CALL_WALKS2, callDepth, callWalks, FS_OP_CACHE_MAX, fsOpCache, stripDotSlash, REDIR_TRUNCATE_OPS, REDIR_FILE_IN_OPS, REDIR_HEREDOC_OPS, FIND_OPTIONS, COPY_RULE_OF, INDIRECT_SHAPE_RE, SOURCES_FILE_RE, SHELL_SET_VARS, pipeOps, callWords, JAILED_GLOB_NAMES, JAILED_DIR_NAMES, shellGlob, GLOB_META, isReaderWord, positionalAfter, NONE, UNKNOWN, FORBIDDEN_PATH_SEGMENTS, BASH_TOOL_NAMES, MCP_EXECUTORS, BUILTIN_FIELDS, ARGV_FIELDS, BARE_WORD, MAX_ARGV_CHARACTERS, exempt, RANK, SEQUENCE_OPS, BIP39_ENGLISH, BIP39_PUBLIC_VECTORS, indices, lengths, hash, MAX_MNEMONIC_HASHES, SECRET_VIEW_LIMITS, IBAN_LENGTH, IBAN_BBAN_SHAPE, B58, B58_INDEX, XPRV_VERSIONS, B62, CRC32_TABLE, GITHUB_TOKEN_RE, B64URL, B64URL_INDEX, CASK_TWO_ZERO_SUFFIX, CASK_FOUR_ZERO_SUFFIX, CF_ODD, CF_EVEN, SPANISH_LETTERS, HETU_CHARS, VERHOEFF_D, VERHOEFF_P, MAX, UNTRUSTED_TOOLS, INJECTION_SIGNALS, MENTION_QUOTE_RE, MENTION_WORD_RE, ASSIGNMENT_CONTEXT_RE, DLP_STOPWORDS, REFERENCE_VALUE_RE, IDENTIFIER_VALUE_RE, PATH_VALUE_RE, DOTTED_REFERENCE_RE, CONCATENATION_RE, EMAIL_VALUE_RE, FIXTURE_NAME_RE, DERIVATIVE_NAME_RE, QUERY_CREDENTIAL_VALUE_RE, OTP_SECRET_RE, OTP_DOC_SECRETS, ASSIGNED_SECRET_VALUE_RE, ASSIGNED_SECRET_NAME_RE, NAME_KEYWORD_RE, ARN_CONTEXT_RE, CIPHER_KEY_NAME_RE, CIPHER_NAME_PARTS, CIPHER_KEY_VALUE_RE, LARAVEL_KEY_VALUE_RE, SQL_PASSWORD_VALUE_RE, GRAFANA_KEY_VALUE_RE, BASIC_VALUE_RE, BASIC_PAIR_RE, BASIC_HEADER_RE, BASIC_HEADER_PAIR_RE, BASIC_PLACEHOLDER_RE, BASIC_TEMPLATE_MARKERS, DROPBOX_SECRET_RE, OTP_CAPTURE_RE, DB_URL_PASSWORD_RE, DLP_PATTERNS, DLP_PATTERNS_GLOBAL, SENSITIVE_PATH_PATTERNS, SENSITIVE_PATH_REGEXES, MAX_DEPTH2, MAX_STRING_BYTES, MAX_JSON_PARSE_BYTES, BATCH_SEPARATOR, IMPERATIVE, SECRET_TARGET, GUARD, SIGNALS, DESTINATION_RE, REUSED_SIGNALS, NEVER_NEGATED, NEGATION_BEFORE, RDR_IN, COPY_VERBS2, LITERAL_VERBS, GIT_PRESCREEN_RE, MAX_PAYLOAD_DEPTH2, MAX_ALIAS_DEPTH, CACHE_MAX, cache, PAYLOAD_SHELLS, CONFIG_SCOPE_FLAGS, CONFIG_VALUE_FLAGS, GLOBAL_VALUE_OPTIONS, GLOBAL_FLAG_OPTIONS, MAX_LOOP_ITEMS, GitWalk, POSITIONAL2, FORCE_PUSH, DESTRUCTIVE, UNREADABLE, PUSH_LONG_VALUE, BRANCH_LONG_VALUE, TAG_LONG_VALUE, CLEAN_LONG_VALUE, HOOKS_BYPASS, NO_VERIFY_SUBS, HOOK_KILL_SWITCHES, COMMIT_LONG_VALUE, CHMOD_OPTION_RE, STAGE_ALL, ADD_LONG_VALUE, CHECK_ID, RULE_NAME, INERT_LINE_RE, CHECK_ID2, INSTRUCTION_NAMES, SETTINGS_RE, HOOK_WORDS_RE, SHELLS, NETCATS, NET_CLIENTS, SENDERS, NETCAT_EXEC_LONG, DECL_DUMPS, PROC_ENVIRON_RE, DEV_NET_RE, SOCAT_PROGRAM_RE, SOCAT_NET_RE, PRESCREEN_RE, MAX_PAYLOAD_DEPTH3, CACHE_MAX2, cache2, dupInOp, REVERSE_SHELL_DESCRIPTION, ENV_EXFIL_DESCRIPTION, DYNAMIC_WORD, MULTICALL, SHELL_VALUE_OPTIONS, INTERPRETERS, OutboundWalk, NPM_INSTALL_VERBS, NPM_EXEC_VERBS, PNPM_INSTALL_VERBS, YARN_INSTALL_VERBS, BUN_INSTALL_VERBS, DLX_VERBS, NON_REGISTRY_RE, NPM_NAME_RE, EXACT_SEMVER_RE, NPM_VALUE_FLAGS, PNPM_VALUE_FLAGS, YARN_VALUE_FLAGS, BUN_VALUE_FLAGS, PIP_VALUE_FLAGS, UV_VALUE_FLAGS, POETRY_VALUE_FLAGS, PIPENV_VALUE_FLAGS, PIPX_VALUE_FLAGS, PY_SPEC_RE, PY_EXACT_RE, EXACT_VERSION_RE, GEM_NAME_RE, GEM_VALUE_FLAGS, BUNDLE_VALUE_FLAGS, CRATE_NAME_RE, CARGO_ADD_VALUE_FLAGS, CARGO_INSTALL_VALUE_FLAGS, GO_VALUE_FLAGS, GO_PATH_RE, NUGET_NAME_RE, DOTNET_ADD_VALUE_FLAGS, DOTNET_TOOL_VALUE_FLAGS, NUGET_VALUE_FLAGS, MAVEN_COORD_RE, COMPOSER_NAME_RE, COMPOSER_VALUE_FLAGS, EDITOR_HEADS, EXTENSION_ID_RE, MANAGER_HEADS, SHELLS2, MAX_NESTING, SHELL_VALUE_FLAGS, NPM_FAMILY, PIP_FAMILY, NPM_FETCH_VERBS, PIP_FETCH_VERBS, NPM_FLAGS, PIP_FLAGS, NPM_VARS, PIP_VARS, PRESCREEN_RE2, PIP_ATTACHED_RE, MAX_PAYLOAD_DEPTH4, PUBLIC_REGISTRY_HOSTS, TUNING_FIELDS, MAP_GOVERNED, KNOB_GOVERNED, CONFIGURABLE_CHECK_IDS, DEFAULT_EGRESS_ALLOWLIST, PRIVATE_HOST_SUFFIXES, SOURCE_COMMANDS, SINK_COMMANDS, OBFUSCATORS, SENSITIVE_PATTERNS, FLAGS_WITH_VALUES, DESTINATION_ARGS, MCP_DESTINATION_KEYS, ARGUMENT_SCAN_LIMITS, RUN_CHAR, runChar, VERDICT_RANK, SQL_DML_KEYWORDS, MAX_DESTINATIONS, MAX_SCAN_CHARS, EMAIL_RE, URL_RE, IBAN_RE, RECIPIENT_KEYS, DESTRUCTIVE_VERB_RE, PII_EMAIL_RE, PII_SSN_RE, PII_PHONE_RE, PII_CC16_RE, PII_CC15_RE, PII_CC14_RE, PII_CC13_RE, PII_CC19_RE, CARD_PATTERNS, PII_ROUTING_RE, ROUTING_LABEL_RE, ROUTING_LABEL_WINDOW, NATIONAL_ID_SHAPES, NATIONAL_ID_LABEL_RE, NATIONAL_ID_LABEL_CS_RE, idLabelIn, NATIONAL_ID_LABEL_WINDOW, NATIONAL_ID_GUARD_RE, PII_IBAN_RE, REALTIME_PII_PATTERNS, MAX_PII_SCAN_BYTES, IBAN_DESTINATION_KEYS, WHOLE_IBAN_RE, JSON_ESCAPE_RE, JSON_ESCAPES, MASKED_KINDS, ENTRY_RE, IBAN_TEXT_RE, EMAIL_TEXT_RE, ACCOUNT_KEY_RE, ACCOUNT_VALUE_RE, MAX_MASK_DEPTH, EMPTY, CURL_SEND_FLAGS, WGET_SEND_FLAGS, IWR_SEND_FLAGS, WRITE_METHODS, GH_READ, GH_WRITE, GH_HOSTNAME_FLAGS, GH_REPO_VALUE_FLAGS, GH_API_VALUE_FLAGS, GIT_FETCH, PUBLISH, SHELLS3, OWN_HEADS, MAX_DEPTH3, CWD_CHANGERS, TERMINAL_ESCAPE_RE, LOOP_MAX_RECORDS, CANARY_MIN_LENGTH, MAX_TEXT, MAX_DEPTH4, MAX_JSON_PARSE, URL_DEPTH, B64_DEPTH, MIN_SEGMENT, SEPARATORS, stripSeparators, looksText, CANARY_DECODERS, VIEWS, LONG_OUTPUT_THRESHOLD_BYTES;
9477
9484
  var init_dist = __esm({
9478
9485
  "packages/policy-engine/dist/index.mjs"() {
9479
9486
  "use strict";
@@ -11563,6 +11570,44 @@ var init_dist = __esm({
11563
11570
  strict: STRICT,
11564
11571
  "block-all": BLOCK_ALL
11565
11572
  };
11573
+ ASI = {
11574
+ ASI01: "Agent Goal Hijack",
11575
+ ASI02: "Tool Misuse and Exploitation",
11576
+ ASI03: "Identity and Privilege Abuse",
11577
+ ASI04: "Agentic Supply Chain Vulnerabilities",
11578
+ ASI05: "Unexpected Code Execution",
11579
+ ASI06: "Memory and Context Poisoning",
11580
+ ASI07: "Insecure Inter-Agent Communication",
11581
+ ASI08: "Cascading Failures",
11582
+ ASI09: "Human-Agent Trust Exploitation",
11583
+ ASI10: "Rogue Agents"
11584
+ };
11585
+ ASI_IDS = Object.keys(ASI);
11586
+ PACK_SHIELD_OWASP = {
11587
+ aws: "ASI02",
11588
+ "bash-safe": "ASI02",
11589
+ docker: "ASI02",
11590
+ filesystem: "ASI02",
11591
+ github: "ASI02",
11592
+ k8s: "ASI02",
11593
+ mongodb: "ASI02",
11594
+ postgres: "ASI02",
11595
+ redis: "ASI02",
11596
+ stripe: "ASI09",
11597
+ paypal: "ASI09",
11598
+ square: "ASI09",
11599
+ plaid: "ASI09",
11600
+ okta: "ASI09",
11601
+ auth0: "ASI09"
11602
+ };
11603
+ PACK_RULE_OWASP = {
11604
+ "packs.bash-safe.pipe-to-shell": "ASI05",
11605
+ "packs.bash-safe.obfuscated-exec": "ASI05",
11606
+ "packs.bash-safe.eval-remote": "ASI05",
11607
+ "packs.bash-safe.eval-dynamic": "ASI05",
11608
+ "packs.aws.iam-changes": "ASI03",
11609
+ "packs.postgres.grant-revoke": "ASI03"
11610
+ };
11566
11611
  VERDICTS = ["off", "log", "review", "block"];
11567
11612
  CHECK_VERDICT_RANK = { off: 0, log: 1, review: 2, block: 3 };
11568
11613
  ALL = VERDICTS;
@@ -11571,6 +11616,7 @@ var init_dist = __esm({
11571
11616
  {
11572
11617
  id: "files.shell-startup",
11573
11618
  group: "files",
11619
+ owasp: "ASI02",
11574
11620
  title: "Shell startup files",
11575
11621
  catches: "Writes, replacements and removals of personal shell startup files",
11576
11622
  values: ALL,
@@ -11580,6 +11626,7 @@ var init_dist = __esm({
11580
11626
  {
11581
11627
  id: "files.system-auth",
11582
11628
  group: "files",
11629
+ owasp: "ASI03",
11583
11630
  title: "System authentication files",
11584
11631
  catches: "Changes to system authentication files and PAM configuration",
11585
11632
  values: ["block"],
@@ -11590,6 +11637,7 @@ var init_dist = __esm({
11590
11637
  {
11591
11638
  id: "files.password-hashes",
11592
11639
  group: "files",
11640
+ owasp: "ASI03",
11593
11641
  title: "System password hashes",
11594
11642
  catches: "Reads and copies of /etc/shadow and /etc/gshadow",
11595
11643
  values: ALL,
@@ -11599,6 +11647,7 @@ var init_dist = __esm({
11599
11647
  {
11600
11648
  id: "files.system-dirs",
11601
11649
  group: "files",
11650
+ owasp: "ASI02",
11602
11651
  title: "System directories",
11603
11652
  catches: "Writes, new files and removals under /usr, /etc, /boot, /bin, /sbin, /lib and /var/log, and uploads of system files",
11604
11653
  values: ALL,
@@ -11608,6 +11657,7 @@ var init_dist = __esm({
11608
11657
  {
11609
11658
  id: "files.agent-instructions",
11610
11659
  group: "files",
11660
+ owasp: "ASI06",
11611
11661
  title: "Agent instruction and memory files",
11612
11662
  catches: "writes to the files every later agent session loads as instructions (CLAUDE.md, AGENTS.md, memory, agents, commands) and changes to the agent's hooks; Standard asks only when the text carries an instruction to hide, skip approvals or touch secrets",
11613
11663
  values: ALL,
@@ -11618,6 +11668,7 @@ var init_dist = __esm({
11618
11668
  {
11619
11669
  id: "commands.inline-exec",
11620
11670
  group: "commands",
11671
+ owasp: "ASI05",
11621
11672
  title: "Inline code execution",
11622
11673
  catches: "inline code (python -c, node -e, a heredoc into an interpreter) that deletes, sends, opens a socket, runs commands, reads protected files or decodes and runs; unreadable inline code",
11623
11674
  values: ALL,
@@ -11627,6 +11678,7 @@ var init_dist = __esm({
11627
11678
  {
11628
11679
  id: "commands.eval-dynamic",
11629
11680
  group: "commands",
11681
+ owasp: "ASI05",
11630
11682
  title: "Eval of dynamic content",
11631
11683
  catches: "generated executable names, shell code from stdin, or dynamic eval/-c payloads",
11632
11684
  values: ALL,
@@ -11636,6 +11688,7 @@ var init_dist = __esm({
11636
11688
  {
11637
11689
  id: "commands.eval-remote",
11638
11690
  group: "commands",
11691
+ owasp: "ASI05",
11639
11692
  title: "Eval of a remote download",
11640
11693
  catches: "eval or sh over the output of curl or wget",
11641
11694
  values: ["block"],
@@ -11646,6 +11699,7 @@ var init_dist = __esm({
11646
11699
  {
11647
11700
  id: "commands.curl-pipe-shell",
11648
11701
  group: "commands",
11702
+ owasp: "ASI05",
11649
11703
  title: "Remote script piped into a shell",
11650
11704
  catches: "curl or wget piped into sh, bash, zsh or PowerShell",
11651
11705
  values: ALL,
@@ -11655,6 +11709,7 @@ var init_dist = __esm({
11655
11709
  {
11656
11710
  id: "commands.rm",
11657
11711
  group: "commands",
11712
+ owasp: "ASI02",
11658
11713
  title: "Delete files",
11659
11714
  catches: "rm outside the known build-artifact paths",
11660
11715
  values: ALL,
@@ -11664,6 +11719,7 @@ var init_dist = __esm({
11664
11719
  {
11665
11720
  id: "commands.rm-home",
11666
11721
  group: "commands",
11722
+ owasp: "ASI02",
11667
11723
  title: "Recursive delete of the home directory",
11668
11724
  catches: "rm -rf on ~, $HOME, /home or /",
11669
11725
  values: ["block"],
@@ -11674,6 +11730,7 @@ var init_dist = __esm({
11674
11730
  {
11675
11731
  id: "commands.chmod",
11676
11732
  group: "commands",
11733
+ owasp: "ASI02",
11677
11734
  title: "World-writable permissions",
11678
11735
  catches: "chmod 777, 0777 or a+rwx",
11679
11736
  values: ALL,
@@ -11683,6 +11740,7 @@ var init_dist = __esm({
11683
11740
  {
11684
11741
  id: "commands.sudo",
11685
11742
  group: "commands",
11743
+ owasp: "ASI03",
11686
11744
  title: "Elevated privileges",
11687
11745
  catches: "a command run through sudo",
11688
11746
  values: ALL,
@@ -11692,6 +11750,7 @@ var init_dist = __esm({
11692
11750
  {
11693
11751
  id: "commands.git-destructive",
11694
11752
  group: "commands",
11753
+ owasp: "ASI02",
11695
11754
  title: "Destructive git operation",
11696
11755
  catches: "force push, reset --hard, clean -f, branch -D or tag delete, also through -C, env, wrappers, variables and aliases",
11697
11756
  values: ALL,
@@ -11701,6 +11760,7 @@ var init_dist = __esm({
11701
11760
  {
11702
11761
  id: "commands.git-hooks-bypass",
11703
11762
  group: "commands",
11763
+ owasp: "ASI10",
11704
11764
  title: "Git hooks bypassed",
11705
11765
  catches: "the agent switches off the git hooks that check its own work: --no-verify, core.hooksPath, HUSKY=0 and its peers, or a hook file removed, emptied or made non-executable",
11706
11766
  values: ALL,
@@ -11710,6 +11770,7 @@ var init_dist = __esm({
11710
11770
  {
11711
11771
  id: "commands.git-stage-all",
11712
11772
  group: "commands",
11773
+ owasp: "ASI02",
11713
11774
  title: "Stage everything at once",
11714
11775
  catches: "git add -A, git add ., git commit -a and other ways to stage every change instead of naming the files; off unless you switch it on",
11715
11776
  values: ALL,
@@ -11719,6 +11780,7 @@ var init_dist = __esm({
11719
11780
  {
11720
11781
  id: "commands.reverse-shell",
11721
11782
  group: "commands",
11783
+ owasp: "ASI05",
11722
11784
  title: "Reverse shell",
11723
11785
  catches: "a shell wired to a network socket: bash -i >& /dev/tcp/\u2026, nc -e, socat exec:, a socket fd read by a shell, a shell piped to and from nc or telnet",
11724
11786
  values: ALL,
@@ -11728,6 +11790,7 @@ var init_dist = __esm({
11728
11790
  {
11729
11791
  id: "commands.node9-disarm",
11730
11792
  group: "commands",
11793
+ owasp: "ASI10",
11731
11794
  title: "node9 disarmed from the shell",
11732
11795
  catches: "a node9 command that clears a session flag, trusts a destination, pauses the gate or weakens a shield, run by the agent",
11733
11796
  values: ALL,
@@ -11737,6 +11800,7 @@ var init_dist = __esm({
11737
11800
  {
11738
11801
  id: "commands.sql-ddl",
11739
11802
  group: "commands",
11803
+ owasp: "ASI02",
11740
11804
  title: "Drop or truncate",
11741
11805
  catches: "DROP or TRUNCATE through a database CLI or a database tool",
11742
11806
  values: ALL,
@@ -11751,6 +11815,7 @@ var init_dist = __esm({
11751
11815
  {
11752
11816
  id: "commands.sql-no-where",
11753
11817
  group: "commands",
11818
+ owasp: "ASI02",
11754
11819
  title: "Unscoped SQL mutation",
11755
11820
  catches: "DELETE or UPDATE without a WHERE clause",
11756
11821
  values: ALL,
@@ -11760,6 +11825,7 @@ var init_dist = __esm({
11760
11825
  {
11761
11826
  id: "commands.temp-binary",
11762
11827
  group: "commands",
11828
+ owasp: "ASI05",
11763
11829
  title: "Binary from a temp directory",
11764
11830
  catches: "an absolute path under /tmp, /var/tmp, /dev/shm or a world-writable file",
11765
11831
  values: ALL,
@@ -11769,6 +11835,7 @@ var init_dist = __esm({
11769
11835
  {
11770
11836
  id: "commands.disk-destroy",
11771
11837
  group: "commands",
11838
+ owasp: "ASI02",
11772
11839
  title: "Disk or filesystem destruction",
11773
11840
  catches: "mkfs, shred, dd and the manual-terminal disaster list",
11774
11841
  values: ALL,
@@ -11778,6 +11845,7 @@ var init_dist = __esm({
11778
11845
  {
11779
11846
  id: "commands.dangerous-word",
11780
11847
  group: "commands",
11848
+ owasp: "ASI02",
11781
11849
  title: "Dangerous word",
11782
11850
  catches: "a word from a pack or from the config dangerousWords list",
11783
11851
  values: ALL,
@@ -11786,6 +11854,7 @@ var init_dist = __esm({
11786
11854
  {
11787
11855
  id: "commands.unanalysable",
11788
11856
  group: "commands",
11857
+ owasp: "ASI02",
11789
11858
  title: "Command too nested to analyse",
11790
11859
  catches: "wrappers nested past the depth the shell parser follows",
11791
11860
  values: ALL,
@@ -11795,6 +11864,7 @@ var init_dist = __esm({
11795
11864
  {
11796
11865
  id: "commands.unknown",
11797
11866
  group: "commands",
11867
+ owasp: "ASI02",
11798
11868
  title: "Any command no check recognised",
11799
11869
  catches: "the strict-mode catch-all",
11800
11870
  values: ["off", "review"],
@@ -11805,6 +11875,7 @@ var init_dist = __esm({
11805
11875
  {
11806
11876
  id: "data.secrets",
11807
11877
  group: "data",
11878
+ owasp: "ASI03",
11808
11879
  title: "Secret in arguments",
11809
11880
  catches: "an API key, token or private key matching one of the DLP patterns",
11810
11881
  values: ALL,
@@ -11814,6 +11885,7 @@ var init_dist = __esm({
11814
11885
  {
11815
11886
  id: "data.secrets-weak",
11816
11887
  group: "data",
11888
+ owasp: "ASI03",
11817
11889
  title: "Weak credential in arguments",
11818
11890
  catches: "a JWT or a bearer token",
11819
11891
  values: ALL,
@@ -11823,6 +11895,7 @@ var init_dist = __esm({
11823
11895
  {
11824
11896
  id: "data.pii",
11825
11897
  group: "data",
11898
+ owasp: "ASI02",
11826
11899
  title: "Personal data in arguments",
11827
11900
  catches: "a social security number or a credit card number",
11828
11901
  values: ALL,
@@ -11832,6 +11905,7 @@ var init_dist = __esm({
11832
11905
  {
11833
11906
  id: "data.credential-files",
11834
11907
  group: "data",
11908
+ owasp: "ASI03",
11835
11909
  title: "Credential file read",
11836
11910
  catches: "~/.ssh, ~/.aws and .env files, through any reader or any file tool",
11837
11911
  values: ALL,
@@ -11840,6 +11914,7 @@ var init_dist = __esm({
11840
11914
  {
11841
11915
  id: "data.credential-files-other",
11842
11916
  group: "data",
11917
+ owasp: "ASI03",
11843
11918
  title: "Other credential file",
11844
11919
  catches: ".netrc, .npmrc, kube and docker config, and a copy of any credential file",
11845
11920
  values: ALL,
@@ -11848,6 +11923,7 @@ var init_dist = __esm({
11848
11923
  {
11849
11924
  id: "data.credential-files-unknown",
11850
11925
  group: "data",
11926
+ owasp: "ASI03",
11851
11927
  title: "Files read by names known only at run time",
11852
11928
  catches: "a reader fed names from a listing that can include credential files (find . | xargs cat)",
11853
11929
  values: ALL,
@@ -11856,6 +11932,7 @@ var init_dist = __esm({
11856
11932
  {
11857
11933
  id: "data.pipe-chain",
11858
11934
  group: "data",
11935
+ owasp: "ASI03",
11859
11936
  title: "Sensitive file piped to the network",
11860
11937
  catches: "a credential file read and piped into curl, nc or ssh",
11861
11938
  values: ALL,
@@ -11865,6 +11942,7 @@ var init_dist = __esm({
11865
11942
  {
11866
11943
  id: "data.pipe-chain-obfuscated",
11867
11944
  group: "data",
11945
+ owasp: "ASI03",
11868
11946
  title: "Obfuscated exfiltration",
11869
11947
  catches: "a sensitive file encoded or compressed on its way to the network",
11870
11948
  values: ALL,
@@ -11877,6 +11955,7 @@ var init_dist = __esm({
11877
11955
  {
11878
11956
  id: "data.env-exfil",
11879
11957
  group: "data",
11958
+ owasp: "ASI03",
11880
11959
  title: "Environment sent out",
11881
11960
  catches: "the whole environment (env, printenv, set, export -p, /proc/*/environ) handed to curl, nc or another sender, through $(\u2026), a pipe or a variable",
11882
11961
  values: ALL,
@@ -11886,6 +11965,7 @@ var init_dist = __esm({
11886
11965
  {
11887
11966
  id: "data.output-secrets",
11888
11967
  group: "data",
11968
+ owasp: "ASI03",
11889
11969
  title: "Secret in tool output",
11890
11970
  catches: "a credential a tool returned; the session is tainted, nothing is stopped",
11891
11971
  values: ["off", "log"],
@@ -11894,6 +11974,7 @@ var init_dist = __esm({
11894
11974
  {
11895
11975
  id: "data.prompt-secrets",
11896
11976
  group: "data",
11977
+ owasp: "ASI03",
11897
11978
  title: "Secret in the prompt",
11898
11979
  catches: "a credential pasted into the conversation",
11899
11980
  values: ALL,
@@ -11902,6 +11983,7 @@ var init_dist = __esm({
11902
11983
  {
11903
11984
  id: "data.canary",
11904
11985
  group: "data",
11986
+ owasp: "ASI03",
11905
11987
  title: "Decoy credential used",
11906
11988
  catches: "a planted decoy value appears in a tool call",
11907
11989
  values: ALL,
@@ -11912,6 +11994,7 @@ var init_dist = __esm({
11912
11994
  {
11913
11995
  id: "network.unknown-host",
11914
11996
  group: "network",
11997
+ owasp: "ASI02",
11915
11998
  title: "Unknown host",
11916
11999
  catches: "a destination on neither the allowlist nor the builtin list",
11917
12000
  values: ["off", "review", "block"],
@@ -11921,6 +12004,7 @@ var init_dist = __esm({
11921
12004
  {
11922
12005
  id: "network.internal-addresses",
11923
12006
  group: "network",
12007
+ owasp: "ASI02",
11924
12008
  title: "Internal address",
11925
12009
  catches: "loopback, the RFC 1918 ranges and carrier-grade NAT",
11926
12010
  values: ["off", "block"],
@@ -11929,6 +12013,7 @@ var init_dist = __esm({
11929
12013
  {
11930
12014
  id: "network.metadata",
11931
12015
  group: "network",
12016
+ owasp: "ASI02",
11932
12017
  title: "Cloud metadata address",
11933
12018
  catches: "169.254.169.254 and its peers, link-local and multicast",
11934
12019
  values: ["block"],
@@ -11939,6 +12024,7 @@ var init_dist = __esm({
11939
12024
  {
11940
12025
  id: "network.taint-egress",
11941
12026
  group: "network",
12027
+ owasp: "ASI01",
11942
12028
  title: "Tainted data sent out",
11943
12029
  catches: "a file or an output flagged earlier in the session reaches a host not on the allowlist",
11944
12030
  values: ALL,
@@ -11952,6 +12038,7 @@ var init_dist = __esm({
11952
12038
  {
11953
12039
  id: "files.jail",
11954
12040
  group: "files",
12041
+ owasp: "ASI03",
11955
12042
  title: "Jailed path",
11956
12043
  catches: "a path the workspace or the developer added to the jail",
11957
12044
  values: ALL,
@@ -11961,6 +12048,7 @@ var init_dist = __esm({
11961
12048
  {
11962
12049
  id: "behavior.loops",
11963
12050
  group: "behavior",
12051
+ owasp: "ASI08",
11964
12052
  title: "Runaway loop",
11965
12053
  catches: "the same tool call repeated past the threshold inside the window",
11966
12054
  values: ["off", "block"],
@@ -11970,6 +12058,7 @@ var init_dist = __esm({
11970
12058
  {
11971
12059
  id: "behavior.prompt-injection",
11972
12060
  group: "behavior",
12061
+ owasp: "ASI01",
11973
12062
  title: "Prompt injection in tool output",
11974
12063
  catches: "instructions aimed at the model inside content a tool returned",
11975
12064
  values: ["off", "log"],
@@ -11978,6 +12067,7 @@ var init_dist = __esm({
11978
12067
  {
11979
12068
  id: "behavior.session-taint",
11980
12069
  group: "behavior",
12070
+ owasp: "ASI01",
11981
12071
  title: "Action after tainted output",
11982
12072
  catches: "a network call or a write after a flagged file or a flagged tool output",
11983
12073
  values: ALL,
@@ -11987,6 +12077,7 @@ var init_dist = __esm({
11987
12077
  {
11988
12078
  id: "behavior.untrusted-content",
11989
12079
  group: "behavior",
12080
+ owasp: "ASI01",
11990
12081
  title: "Send after reading outside content",
11991
12082
  catches: "a send to an unknown destination, a destination found in what was read, or a destructive call after the session read an email, a web page or an issue",
11992
12083
  values: ["off", "log", "review"],
@@ -11997,6 +12088,7 @@ var init_dist = __esm({
11997
12088
  {
11998
12089
  id: "loading.skill-tamper",
11999
12090
  group: "loading",
12091
+ owasp: "ASI04",
12000
12092
  title: "Skill file changed",
12001
12093
  catches: "a skill or plugin file whose hash differs from the one approved",
12002
12094
  values: ["off", "log", "block"],
@@ -12006,6 +12098,7 @@ var init_dist = __esm({
12006
12098
  {
12007
12099
  id: "loading.mcp-tamper",
12008
12100
  group: "loading",
12101
+ owasp: "ASI04",
12009
12102
  title: "MCP server changed",
12010
12103
  catches: "tool definitions that differ from the pinned ones",
12011
12104
  values: ALL,
@@ -12015,6 +12108,7 @@ var init_dist = __esm({
12015
12108
  {
12016
12109
  id: "loading.malicious-package",
12017
12110
  group: "loading",
12111
+ owasp: "ASI04",
12018
12112
  title: "Malicious package",
12019
12113
  catches: "an install of a package the index flags",
12020
12114
  values: ALL,
@@ -12024,6 +12118,7 @@ var init_dist = __esm({
12024
12118
  {
12025
12119
  id: "loading.unknown-registry",
12026
12120
  group: "loading",
12121
+ owasp: "ASI04",
12027
12122
  title: "Package from an unknown registry",
12028
12123
  catches: "an install that names a registry on the command line (--registry, --index-url, -i, npm_config_registry=\u2026) that is not the public one, not in your npm, yarn, bun, pip or uv config and not on the allowlist",
12029
12124
  values: ALL,
@@ -12038,6 +12133,7 @@ var init_dist = __esm({
12038
12133
  {
12039
12134
  id: "actions.money",
12040
12135
  group: "actions",
12136
+ owasp: "ASI09",
12041
12137
  title: "Money moves",
12042
12138
  catches: "a refund, payout, transfer, charge or withdrawal through an app with no protection of its own",
12043
12139
  values: ALL,
@@ -12050,6 +12146,7 @@ var init_dist = __esm({
12050
12146
  {
12051
12147
  id: "actions.access",
12052
12148
  group: "actions",
12149
+ owasp: "ASI09",
12053
12150
  title: "Accounts and access change",
12054
12151
  catches: "a password, key, role, permission or user changed through an app with no protection of its own",
12055
12152
  values: ALL,
@@ -12059,6 +12156,7 @@ var init_dist = __esm({
12059
12156
  {
12060
12157
  id: "actions.publish",
12061
12158
  group: "actions",
12159
+ owasp: "ASI09",
12062
12160
  title: "Something is published",
12063
12161
  catches: "a release, package, deploy or public post through an app with no protection of its own",
12064
12162
  values: ALL,
@@ -12071,6 +12169,7 @@ var init_dist = __esm({
12071
12169
  {
12072
12170
  id: "actions.settings",
12073
12171
  group: "actions",
12172
+ owasp: "ASI09",
12074
12173
  title: "Repository, account and mailbox settings change",
12075
12174
  catches: "a repository made public, a deploy key, webhook or CI secret added, branch protection changed, mail forwarded outside or a public share link, through an app",
12076
12175
  values: ALL,
@@ -12080,6 +12179,7 @@ var init_dist = __esm({
12080
12179
  {
12081
12180
  id: "actions.protected-branch",
12082
12181
  group: "actions",
12182
+ owasp: "ASI09",
12083
12183
  title: "The main branch changes through an app",
12084
12184
  catches: "a merge, a commit straight to main or master, or a CI workflow file written through an app",
12085
12185
  values: ALL,
@@ -19037,8 +19137,8 @@ var ConfigFileSchema = z.object({
19037
19137
  }).strict();
19038
19138
  function formatIssues(issues) {
19039
19139
  const lines = issues.map((issue) => {
19040
- const path32 = issue.path.length > 0 ? issue.path.map(String).join(".") : "root";
19041
- return ` \u2022 ${path32}: ${issue.message}`;
19140
+ const path33 = issue.path.length > 0 ? issue.path.map(String).join(".") : "root";
19141
+ return ` \u2022 ${path33}: ${issue.message}`;
19042
19142
  });
19043
19143
  return `Invalid config:
19044
19144
  ${lines.join("\n")}`;
@@ -19051,9 +19151,9 @@ function prunePaths(root, paths) {
19051
19151
  const yi = y[y.length - 1];
19052
19152
  return typeof xi === "number" && typeof yi === "number" ? yi - xi : 0;
19053
19153
  });
19054
- for (const path32 of ordered) {
19154
+ for (const path33 of ordered) {
19055
19155
  let cur = root;
19056
- for (const key of path32.slice(0, -1)) {
19156
+ for (const key of path33.slice(0, -1)) {
19057
19157
  if (cur === null || typeof cur !== "object") {
19058
19158
  cur = void 0;
19059
19159
  break;
@@ -19061,7 +19161,7 @@ function prunePaths(root, paths) {
19061
19161
  cur = cur[key];
19062
19162
  }
19063
19163
  if (cur === null || typeof cur !== "object") continue;
19064
- const last = path32[path32.length - 1];
19164
+ const last = path33[path33.length - 1];
19065
19165
  if (Array.isArray(cur)) {
19066
19166
  const i = Number(last);
19067
19167
  if (Number.isInteger(i) && i >= 0 && i < cur.length) {
@@ -19097,7 +19197,7 @@ function sanitizeConfig(raw) {
19097
19197
  return issue.keys.map((k) => [...at, k]);
19098
19198
  }
19099
19199
  return [at.slice(0, -level || void 0)];
19100
- }).filter((path32) => path32.length > 0);
19200
+ }).filter((path33) => path33.length > 0);
19101
19201
  if (paths.length === 0 || !prunePaths(working, paths)) break;
19102
19202
  }
19103
19203
  if (ConfigFileSchema.safeParse(working).success) break;
@@ -20541,13 +20641,13 @@ function getConfig(cwd) {
20541
20641
  }
20542
20642
  if (Array.isArray(mc.jailPaths)) {
20543
20643
  for (const jp of mc.jailPaths) {
20544
- const path32 = typeof jp?.path === "string" ? jp.path.trim() : "";
20545
- if (!path32) continue;
20644
+ const path33 = typeof jp?.path === "string" ? jp.path.trim() : "";
20645
+ if (!path33) continue;
20546
20646
  const verdict = jp?.verdict === "review" ? "review" : "block";
20547
- for (const r of pathRules(path32, verdict, "org-managed jail")) {
20647
+ for (const r of pathRules(path33, verdict, "org-managed jail")) {
20548
20648
  mergedPolicy.smartRules.push({ ...r, name: `org:${r.name}` });
20549
20649
  }
20550
- mergedPolicy.managedJailPaths.push({ path: path32, verdict });
20650
+ mergedPolicy.managedJailPaths.push({ path: path33, verdict });
20551
20651
  }
20552
20652
  }
20553
20653
  if (Array.isArray(mc.trustedHosts)) {
@@ -22392,12 +22492,45 @@ function getPersistentDecision(toolName) {
22392
22492
  // src/auth/daemon.ts
22393
22493
  init_esm_shims();
22394
22494
  init_forecast_context();
22395
- import fs15 from "fs";
22495
+ import fs16 from "fs";
22396
22496
  import http from "http";
22397
22497
  import net from "net";
22398
- import path16 from "path";
22498
+ import path17 from "path";
22399
22499
  import os10 from "os";
22400
22500
 
22501
+ // src/utils/activity-socket.ts
22502
+ init_esm_shims();
22503
+ import fs15 from "fs";
22504
+ import path16 from "path";
22505
+
22506
+ // src/utils/own-dir.ts
22507
+ init_esm_shims();
22508
+
22509
+ // src/utils/activity-socket.ts
22510
+ var currentUid = () => typeof process.getuid === "function" ? process.getuid() : void 0;
22511
+ function isPrivateDir(dir2, uid = currentUid()) {
22512
+ try {
22513
+ const st = fs15.lstatSync(dir2);
22514
+ if (st.isSymbolicLink() || !st.isDirectory()) return false;
22515
+ if (uid !== void 0 && st.uid !== uid) return false;
22516
+ return (st.mode & 18) === 0;
22517
+ } catch {
22518
+ return false;
22519
+ }
22520
+ }
22521
+ var WINDOWS_PIPE = /^\\\\\.\\pipe\\node9-activity-[0-9a-f]{32}$/;
22522
+ function isTrustedActivitySocket(socketPath, uid = currentUid()) {
22523
+ if (process.platform === "win32") return WINDOWS_PIPE.test(socketPath);
22524
+ try {
22525
+ const st = fs15.lstatSync(socketPath);
22526
+ if (!st.isSocket()) return false;
22527
+ if (uid !== void 0 && st.uid !== uid) return false;
22528
+ } catch {
22529
+ return false;
22530
+ }
22531
+ return isPrivateDir(path16.dirname(socketPath), uid);
22532
+ }
22533
+
22401
22534
  // src/auth/decision-record.ts
22402
22535
  init_esm_shims();
22403
22536
  var CHANNELS = ["terminal", "monitor", "native", "cloud"];
@@ -22547,10 +22680,20 @@ function recordFromLegacyWait(body, now = Date.now()) {
22547
22680
  }
22548
22681
 
22549
22682
  // src/auth/daemon.ts
22550
- var ACTIVITY_SOCKET_PATH = process.platform === "win32" ? "\\\\.\\pipe\\node9-activity" : path16.join(os10.tmpdir(), "node9-activity.sock");
22683
+ function daemonActivitySocket(home = os10.homedir()) {
22684
+ try {
22685
+ const raw = fs16.readFileSync(path17.join(home, ".node9", "daemon.pid"), "utf-8");
22686
+ const p = JSON.parse(raw).activitySocket;
22687
+ return typeof p === "string" && isTrustedActivitySocket(p) ? p : null;
22688
+ } catch {
22689
+ return null;
22690
+ }
22691
+ }
22551
22692
  var ACTIVITY_SOCKET_TIMEOUT_MS = 500;
22552
22693
  function notifyActivitySocket(data, opts = {}) {
22553
22694
  if (forecastRun()) return Promise.resolve(false);
22695
+ const target = opts.socketPath ?? daemonActivitySocket();
22696
+ if (!target) return Promise.resolve(false);
22554
22697
  return new Promise((resolve) => {
22555
22698
  let settled = false;
22556
22699
  let sock = null;
@@ -22564,7 +22707,7 @@ function notifyActivitySocket(data, opts = {}) {
22564
22707
  const timer = setTimeout(() => finish(false), opts.timeoutMs ?? ACTIVITY_SOCKET_TIMEOUT_MS);
22565
22708
  try {
22566
22709
  const payload = JSON.stringify(data);
22567
- sock = net.createConnection(opts.socketPath ?? ACTIVITY_SOCKET_PATH);
22710
+ sock = net.createConnection(target);
22568
22711
  sock.on("connect", () => {
22569
22712
  sock.on("close", () => finish(true));
22570
22713
  sock.end(payload);
@@ -22603,9 +22746,9 @@ var DAEMON_HOST = "127.0.0.1";
22603
22746
  function getInternalToken() {
22604
22747
  if (forecastRun()) return null;
22605
22748
  try {
22606
- const pidFile = path16.join(os10.homedir(), ".node9", "daemon.pid");
22607
- if (!fs15.existsSync(pidFile)) return null;
22608
- const data = JSON.parse(fs15.readFileSync(pidFile, "utf-8"));
22749
+ const pidFile = path17.join(os10.homedir(), ".node9", "daemon.pid");
22750
+ if (!fs16.existsSync(pidFile)) return null;
22751
+ const data = JSON.parse(fs16.readFileSync(pidFile, "utf-8"));
22609
22752
  process.kill(data.pid, 0);
22610
22753
  return data.internalToken ?? null;
22611
22754
  } catch {
@@ -22614,12 +22757,12 @@ function getInternalToken() {
22614
22757
  }
22615
22758
  function isDaemonRunning() {
22616
22759
  if (forecastRun()) return false;
22617
- const pidFile = path16.join(os10.homedir(), ".node9", "daemon.pid");
22618
- if (fs15.existsSync(pidFile)) {
22760
+ const pidFile = path17.join(os10.homedir(), ".node9", "daemon.pid");
22761
+ if (fs16.existsSync(pidFile)) {
22619
22762
  let pid;
22620
22763
  let port;
22621
22764
  try {
22622
- const data = JSON.parse(fs15.readFileSync(pidFile, "utf-8"));
22765
+ const data = JSON.parse(fs16.readFileSync(pidFile, "utf-8"));
22623
22766
  pid = data.pid;
22624
22767
  port = data.port;
22625
22768
  } catch {
@@ -22637,7 +22780,7 @@ function isDaemonRunning() {
22637
22780
  } catch (err) {
22638
22781
  if (err instanceof Error && "code" in err && err.code === "ESRCH") {
22639
22782
  try {
22640
- fs15.unlinkSync(pidFile);
22783
+ fs16.unlinkSync(pidFile);
22641
22784
  } catch {
22642
22785
  }
22643
22786
  }
@@ -22977,9 +23120,9 @@ import { randomUUID as randomUUID2 } from "crypto";
22977
23120
 
22978
23121
  // src/apps/state.ts
22979
23122
  init_esm_shims();
22980
- import fs17 from "fs";
23123
+ import fs18 from "fs";
22981
23124
  import os12 from "os";
22982
- import path18 from "path";
23125
+ import path19 from "path";
22983
23126
 
22984
23127
  // src/apps/catalog.ts
22985
23128
  init_esm_shims();
@@ -23113,8 +23256,8 @@ init_audit();
23113
23256
 
23114
23257
  // src/daemon/mcp-tools.ts
23115
23258
  init_esm_shims();
23116
- import fs16 from "fs";
23117
- import path17 from "path";
23259
+ import fs17 from "fs";
23260
+ import path18 from "path";
23118
23261
  import os11 from "os";
23119
23262
 
23120
23263
  // src/mcp-cmd.ts
@@ -23122,13 +23265,13 @@ init_esm_shims();
23122
23265
 
23123
23266
  // src/daemon/mcp-tools.ts
23124
23267
  function getMcpToolsFile() {
23125
- return path17.join(os11.homedir(), ".node9", "mcp-tools.json");
23268
+ return path18.join(os11.homedir(), ".node9", "mcp-tools.json");
23126
23269
  }
23127
23270
  function readMcpToolsConfig() {
23128
23271
  try {
23129
23272
  const file2 = getMcpToolsFile();
23130
- if (!fs16.existsSync(file2)) return {};
23131
- const raw = fs16.readFileSync(file2, "utf-8");
23273
+ if (!fs17.existsSync(file2)) return {};
23274
+ const raw = fs17.readFileSync(file2, "utf-8");
23132
23275
  return JSON.parse(raw);
23133
23276
  } catch {
23134
23277
  return {};
@@ -23137,7 +23280,7 @@ function readMcpToolsConfig() {
23137
23280
 
23138
23281
  // src/apps/state.ts
23139
23282
  function appsFilePath(home = os12.homedir()) {
23140
- return path18.join(home, ".node9", "apps.json");
23283
+ return path19.join(home, ".node9", "apps.json");
23141
23284
  }
23142
23285
  var SIGNAL_KINDS = /* @__PURE__ */ new Set(["mcp-server", "command", "package", "env-name"]);
23143
23286
  function emptyFile() {
@@ -23185,7 +23328,7 @@ function readAppsFile(home) {
23185
23328
  function readAppsFileStrict(home) {
23186
23329
  let text;
23187
23330
  try {
23188
- text = fs17.readFileSync(appsFilePath(home), "utf8");
23331
+ text = fs18.readFileSync(appsFilePath(home), "utf8");
23189
23332
  } catch (e) {
23190
23333
  return e.code === "ENOENT" ? emptyFile() : null;
23191
23334
  }
@@ -23200,7 +23343,7 @@ var NO_LINKS = /* @__PURE__ */ Object.create(null);
23200
23343
  function localLinks() {
23201
23344
  const file2 = appsFilePath();
23202
23345
  try {
23203
- const mtimeMs = fs17.statSync(file2).mtimeMs;
23346
+ const mtimeMs = fs18.statSync(file2).mtimeMs;
23204
23347
  if (!linkCache || linkCache.file !== file2 || linkCache.mtimeMs !== mtimeMs) {
23205
23348
  linkCache = { mtimeMs, file: file2, links: readAppsFile().links };
23206
23349
  }
@@ -23241,16 +23384,16 @@ function resolveLinkedServer(label2, opts = {}) {
23241
23384
 
23242
23385
  // src/auth/orchestrator.ts
23243
23386
  import os21 from "os";
23244
- import path31 from "path";
23387
+ import path32 from "path";
23245
23388
 
23246
23389
  // src/ui/native.ts
23247
23390
  init_esm_shims();
23248
23391
  import { spawn } from "child_process";
23249
- import path20 from "path";
23392
+ import path21 from "path";
23250
23393
 
23251
23394
  // src/context-sniper.ts
23252
23395
  init_esm_shims();
23253
- import path19 from "path";
23396
+ import path20 from "path";
23254
23397
  function smartTruncate(str, maxLen = 500) {
23255
23398
  if (str.length <= maxLen) return str;
23256
23399
  const edge = Math.floor(maxLen / 2) - 3;
@@ -23318,7 +23461,7 @@ function computeRiskMetadata(args, tier, blockedByLabel, matchedField, matchedWo
23318
23461
  intent = "EDIT";
23319
23462
  if (obj.file_path) {
23320
23463
  editFilePath = String(obj.file_path);
23321
- editFileName = path19.basename(editFilePath);
23464
+ editFileName = path20.basename(editFilePath);
23322
23465
  }
23323
23466
  const result = extractContext(String(obj.new_string), matchedWord);
23324
23467
  contextSnippet = result.snippet;
@@ -23387,7 +23530,7 @@ function formatArgs(args, matchedField, matchedWord) {
23387
23530
  if (typeof parsed === "object" && !Array.isArray(parsed)) {
23388
23531
  const obj = parsed;
23389
23532
  if (obj.old_string !== void 0 && obj.new_string !== void 0) {
23390
- const file2 = obj.file_path ? path20.basename(String(obj.file_path)) : "file";
23533
+ const file2 = obj.file_path ? path21.basename(String(obj.file_path)) : "file";
23391
23534
  const oldPreview = smartTruncate(String(obj.old_string), 120);
23392
23535
  const newPreview = extractContext(String(obj.new_string), matchedWord).snippet;
23393
23536
  return {
@@ -23591,25 +23734,25 @@ end run`;
23591
23734
 
23592
23735
  // src/canary/registry.ts
23593
23736
  init_esm_shims();
23594
- import fs19 from "fs";
23737
+ import fs20 from "fs";
23595
23738
  import os14 from "os";
23596
- import path22 from "path";
23739
+ import path23 from "path";
23597
23740
  init_dist();
23598
23741
 
23599
23742
  // src/shields/jail.ts
23600
23743
  init_esm_shims();
23601
- import fs18 from "fs";
23744
+ import fs19 from "fs";
23602
23745
  import os13 from "os";
23603
- import path21 from "path";
23746
+ import path22 from "path";
23604
23747
  init_dist();
23605
23748
  var USER_JAIL_SHIELD = "user-jail";
23606
23749
  function jailStorePath() {
23607
- return path21.join(os13.homedir(), ".node9", "jail-paths.json");
23750
+ return path22.join(os13.homedir(), ".node9", "jail-paths.json");
23608
23751
  }
23609
23752
  function readJailPaths() {
23610
23753
  let text;
23611
23754
  try {
23612
- text = fs18.readFileSync(jailStorePath(), "utf8");
23755
+ text = fs19.readFileSync(jailStorePath(), "utf8");
23613
23756
  } catch (err) {
23614
23757
  if (err.code === "ENOENT") return [];
23615
23758
  throw err;
@@ -23638,7 +23781,7 @@ function findJailedPathIn(candidate, paths) {
23638
23781
 
23639
23782
  // src/canary/registry.ts
23640
23783
  function canaryStorePath() {
23641
- return path22.join(os14.homedir(), ".node9", "canaries.json");
23784
+ return path23.join(os14.homedir(), ".node9", "canaries.json");
23642
23785
  }
23643
23786
  function isRecord(x) {
23644
23787
  if (!x || typeof x !== "object") return false;
@@ -23649,7 +23792,7 @@ function loadCanaries(opts) {
23649
23792
  const p = canaryStorePath();
23650
23793
  let raw;
23651
23794
  try {
23652
- raw = fs19.readFileSync(p, "utf-8");
23795
+ raw = fs20.readFileSync(p, "utf-8");
23653
23796
  } catch (e) {
23654
23797
  if (e.code === "ENOENT") return [];
23655
23798
  throw e;
@@ -23677,21 +23820,21 @@ init_dist();
23677
23820
  // src/auth/session-script.ts
23678
23821
  init_esm_shims();
23679
23822
  init_dist();
23680
- import fs20 from "fs";
23823
+ import fs21 from "fs";
23681
23824
  import os15 from "os";
23682
- import path23 from "path";
23825
+ import path24 from "path";
23683
23826
  var MAX_SCRIPT_BYTES = 64 * 1024;
23684
23827
  var MAX_RECORDED_WRITES = 32;
23685
23828
  function readScriptFile(resolved) {
23686
23829
  let fd;
23687
23830
  try {
23688
- fd = fs20.openSync(resolved, fs20.constants.O_RDONLY | (fs20.constants.O_NONBLOCK ?? 0));
23689
- const st = fs20.fstatSync(fd);
23831
+ fd = fs21.openSync(resolved, fs21.constants.O_RDONLY | (fs21.constants.O_NONBLOCK ?? 0));
23832
+ const st = fs21.fstatSync(fd);
23690
23833
  if (!st.isFile() || st.size > MAX_SCRIPT_BYTES) return null;
23691
23834
  const buf = Buffer.alloc(MAX_SCRIPT_BYTES + 1);
23692
23835
  let n = 0;
23693
23836
  while (n < buf.length) {
23694
- const got = fs20.readSync(fd, buf, n, buf.length - n, n);
23837
+ const got = fs21.readSync(fd, buf, n, buf.length - n, n);
23695
23838
  if (got === 0) break;
23696
23839
  n += got;
23697
23840
  }
@@ -23702,7 +23845,7 @@ function readScriptFile(resolved) {
23702
23845
  } finally {
23703
23846
  if (fd !== void 0) {
23704
23847
  try {
23705
- fs20.closeSync(fd);
23848
+ fs21.closeSync(fd);
23706
23849
  } catch {
23707
23850
  }
23708
23851
  }
@@ -23710,7 +23853,7 @@ function readScriptFile(resolved) {
23710
23853
  }
23711
23854
  function absolute(p, cwd, home) {
23712
23855
  const spelled = p === "~" || p.startsWith("~/") ? home + p.slice(1) : p;
23713
- return path23.resolve(cwd, spelled);
23856
+ return path24.resolve(cwd, spelled);
23714
23857
  }
23715
23858
  async function resolveSessionScript(toolName, args, cwd, layers, deps, home = os15.homedir()) {
23716
23859
  try {
@@ -23772,27 +23915,27 @@ init_dist();
23772
23915
 
23773
23916
  // src/exposure/known-hosts.ts
23774
23917
  init_esm_shims();
23775
- import fs22 from "fs";
23776
- import path25 from "path";
23918
+ import fs23 from "fs";
23919
+ import path26 from "path";
23777
23920
 
23778
23921
  // src/utils/git-remotes.ts
23779
23922
  init_esm_shims();
23780
23923
  init_dist();
23781
- import fs21 from "fs";
23782
- import path24 from "path";
23924
+ import fs22 from "fs";
23925
+ import path25 from "path";
23783
23926
  function readSmallFile(p, max) {
23784
23927
  let fd;
23785
23928
  try {
23786
- fd = fs21.openSync(p, fs21.constants.O_RDONLY | (fs21.constants.O_NOFOLLOW ?? 0));
23787
- const st = fs21.fstatSync(fd);
23929
+ fd = fs22.openSync(p, fs22.constants.O_RDONLY | (fs22.constants.O_NOFOLLOW ?? 0));
23930
+ const st = fs22.fstatSync(fd);
23788
23931
  if (!st.isFile() || st.size > max) return null;
23789
23932
  const buf = Buffer.alloc(st.size);
23790
- const n = fs21.readSync(fd, buf, 0, st.size, 0);
23933
+ const n = fs22.readSync(fd, buf, 0, st.size, 0);
23791
23934
  return buf.subarray(0, n).toString("utf8");
23792
23935
  } catch {
23793
23936
  return null;
23794
23937
  } finally {
23795
- if (fd !== void 0) fs21.closeSync(fd);
23938
+ if (fd !== void 0) fs22.closeSync(fd);
23796
23939
  }
23797
23940
  }
23798
23941
  function gitRemoteHost(url) {
@@ -23811,20 +23954,20 @@ function gitRemoteHost(url) {
23811
23954
  return null;
23812
23955
  }
23813
23956
  function findGitConfig(dir2, walkUp = true) {
23814
- let cur = path24.resolve(dir2);
23957
+ let cur = path25.resolve(dir2);
23815
23958
  for (let i = 0; i < (walkUp ? 64 : 1); i++) {
23816
- const dotGit = path24.join(cur, ".git");
23817
- const direct = readSmallFile(path24.join(dotGit, "config"), 1e6);
23959
+ const dotGit = path25.join(cur, ".git");
23960
+ const direct = readSmallFile(path25.join(dotGit, "config"), 1e6);
23818
23961
  if (direct !== null) return direct;
23819
23962
  const pointer = readSmallFile(dotGit, 4096);
23820
23963
  const m = pointer && /^gitdir:\s*(.+?)\s*$/m.exec(pointer);
23821
23964
  if (m) {
23822
- let gitDir = path24.resolve(cur, m[1]);
23823
- const common = readSmallFile(path24.join(gitDir, "commondir"), 4096);
23824
- if (common !== null) gitDir = path24.resolve(gitDir, common.trim());
23825
- return readSmallFile(path24.join(gitDir, "config"), 1e6);
23965
+ let gitDir = path25.resolve(cur, m[1]);
23966
+ const common = readSmallFile(path25.join(gitDir, "commondir"), 4096);
23967
+ if (common !== null) gitDir = path25.resolve(gitDir, common.trim());
23968
+ return readSmallFile(path25.join(gitDir, "config"), 1e6);
23826
23969
  }
23827
- const parent = path24.dirname(cur);
23970
+ const parent = path25.dirname(cur);
23828
23971
  if (parent === cur) return null;
23829
23972
  cur = parent;
23830
23973
  }
@@ -23834,12 +23977,12 @@ var cache4 = /* @__PURE__ */ new Map();
23834
23977
  function readGitRemotes(dir2, opts = {}) {
23835
23978
  if (!dir2) return [];
23836
23979
  const walkUp = opts.walkUp !== false;
23837
- const key = `${walkUp ? "up" : "at"}:${path24.resolve(dir2)}`;
23980
+ const key = `${walkUp ? "up" : "at"}:${path25.resolve(dir2)}`;
23838
23981
  const hit = cache4.get(key);
23839
23982
  if (hit) return hit;
23840
23983
  const out = [];
23841
23984
  try {
23842
- const cfg = findGitConfig(path24.resolve(dir2), walkUp);
23985
+ const cfg = findGitConfig(path25.resolve(dir2), walkUp);
23843
23986
  if (cfg !== null) {
23844
23987
  let current = null;
23845
23988
  for (const line of cfg.split(/\r?\n/)) {
@@ -23875,15 +24018,15 @@ var ECOSYSTEMS = [
23875
24018
  ];
23876
24019
  var cache5 = /* @__PURE__ */ new Map();
23877
24020
  function manifestRoot(dir2) {
23878
- let cur = path25.resolve(dir2);
24021
+ let cur = path26.resolve(dir2);
23879
24022
  for (let i = 0; i < 64; i++) {
23880
24023
  for (const [m] of ECOSYSTEMS) {
23881
24024
  try {
23882
- if (fs22.existsSync(path25.join(cur, m))) return cur;
24025
+ if (fs23.existsSync(path26.join(cur, m))) return cur;
23883
24026
  } catch {
23884
24027
  }
23885
24028
  }
23886
- const parent = path25.dirname(cur);
24029
+ const parent = path26.dirname(cur);
23887
24030
  if (parent === cur) return null;
23888
24031
  cur = parent;
23889
24032
  }
@@ -23892,7 +24035,7 @@ function manifestRoot(dir2) {
23892
24035
  function knownProjectHosts(dir2) {
23893
24036
  const empty = { hosts: /* @__PURE__ */ new Set(), repos: /* @__PURE__ */ new Set(), remotes: /* @__PURE__ */ new Map() };
23894
24037
  if (!dir2) return empty;
23895
- const key = path25.resolve(dir2);
24038
+ const key = path26.resolve(dir2);
23896
24039
  const hit = cache5.get(key);
23897
24040
  if (hit) return hit;
23898
24041
  const out = { hosts: /* @__PURE__ */ new Set(), repos: /* @__PURE__ */ new Set(), remotes: /* @__PURE__ */ new Map() };
@@ -23905,10 +24048,10 @@ function knownProjectHosts(dir2) {
23905
24048
  const root = manifestRoot(key);
23906
24049
  if (root !== null) {
23907
24050
  for (const [m, registry] of ECOSYSTEMS) {
23908
- if (fs22.existsSync(path25.join(root, m))) out.hosts.add(registry);
24051
+ if (fs23.existsSync(path26.join(root, m))) out.hosts.add(registry);
23909
24052
  }
23910
24053
  try {
23911
- if (fs22.readdirSync(root).some((f) => f.endsWith(".gemspec")))
24054
+ if (fs23.readdirSync(root).some((f) => f.endsWith(".gemspec")))
23912
24055
  out.hosts.add("host:rubygems.org");
23913
24056
  } catch {
23914
24057
  }
@@ -23922,9 +24065,9 @@ function knownProjectHosts(dir2) {
23922
24065
  // src/exposure/writes.ts
23923
24066
  init_esm_shims();
23924
24067
  init_dist();
23925
- import fs23 from "fs";
24068
+ import fs24 from "fs";
23926
24069
  import os16 from "os";
23927
- import path26 from "path";
24070
+ import path27 from "path";
23928
24071
  var WRITE_OPS = /* @__PURE__ */ new Set(["write", "create", "remove"]);
23929
24072
  var LIFECYCLE_RE = /"(scripts|preinstall|install|postinstall|prepare|prepublish|prepublishOnly|prepack|postpack|publish|postpublish)"\s*:/;
23930
24073
  function writtenContent(args) {
@@ -23953,7 +24096,7 @@ function packageScriptsTouched(args, absPath, shellCommand) {
23953
24096
  if (typeof a.content === "string") {
23954
24097
  try {
23955
24098
  const next = JSON.parse(a.content);
23956
- const prev = JSON.parse(fs23.readFileSync(absPath, "utf8"));
24099
+ const prev = JSON.parse(fs24.readFileSync(absPath, "utf8"));
23957
24100
  return JSON.stringify(next.scripts ?? null) !== JSON.stringify(prev.scripts ?? null);
23958
24101
  } catch {
23959
24102
  return LIFECYCLE_RE.test(a.content);
@@ -23974,7 +24117,7 @@ function judgeWritesAfterExposure(opts) {
23974
24117
  seen.add(p);
23975
24118
  if (p === "/dev" || p.startsWith("/dev/")) continue;
23976
24119
  if (root !== null && isInside(root, p)) {
23977
- if (isAgentInstructionPath(p, root) && (path26.basename(p) !== "package.json" || packageScriptsTouched(opts.args, p, opts.shellCommand)))
24120
+ if (isAgentInstructionPath(p, root) && (path27.basename(p) !== "package.json" || packageScriptsTouched(opts.args, p, opts.shellCommand)))
23978
24121
  holds.push({ path: p, why: "agent-instruction" });
23979
24122
  continue;
23980
24123
  }
@@ -23997,9 +24140,9 @@ function judgeWritesAfterExposure(opts) {
23997
24140
  // src/exposure/marker.ts
23998
24141
  init_esm_shims();
23999
24142
  import crypto3 from "crypto";
24000
- import fs24 from "fs";
24143
+ import fs25 from "fs";
24001
24144
  import os17 from "os";
24002
- import path27 from "path";
24145
+ import path28 from "path";
24003
24146
 
24004
24147
  // src/daemon/exposure-store.ts
24005
24148
  init_esm_shims();
@@ -24008,18 +24151,18 @@ var SESSION_EXPOSURE_TTL_MS = 4 * 60 * 60 * 1e3;
24008
24151
  // src/exposure/marker.ts
24009
24152
  init_forecast_context();
24010
24153
  function dir() {
24011
- return path27.join(os17.homedir(), ".node9", "exposure-sessions");
24154
+ return path28.join(os17.homedir(), ".node9", "exposure-sessions");
24012
24155
  }
24013
24156
  function file(sessionId) {
24014
24157
  const id = crypto3.createHash("sha256").update(sessionId).digest("hex").slice(0, 32);
24015
- return path27.join(dir(), id);
24158
+ return path28.join(dir(), id);
24016
24159
  }
24017
24160
  function maybeSessionExposed(sessionId) {
24018
24161
  if (!sessionId) return false;
24019
24162
  const forecast = forecastRun();
24020
24163
  if (forecast) return forecast.session.checkExposure(forecast.now) !== null;
24021
24164
  try {
24022
- const st = fs24.statSync(file(sessionId));
24165
+ const st = fs25.statSync(file(sessionId));
24023
24166
  return Date.now() - st.mtimeMs < SESSION_EXPOSURE_TTL_MS;
24024
24167
  } catch (e) {
24025
24168
  return e.code !== "ENOENT";
@@ -24028,7 +24171,7 @@ function maybeSessionExposed(sessionId) {
24028
24171
 
24029
24172
  // src/exposure/roles.ts
24030
24173
  init_esm_shims();
24031
- import fs25 from "fs";
24174
+ import fs26 from "fs";
24032
24175
  var EXPOSURE_LABEL = "\u{1F6E1}\uFE0F Node9 Exposure";
24033
24176
  var AGENT_INTERNAL_PREFIXES = ["ccd_", "visualize"];
24034
24177
  function foldServerName(name) {
@@ -24038,7 +24181,7 @@ var inventoryCache = null;
24038
24181
  var inventoryStamp = null;
24039
24182
  function inventoryFileStamp() {
24040
24183
  try {
24041
- const st = fs25.statSync(getMcpToolsFile());
24184
+ const st = fs26.statSync(getMcpToolsFile());
24042
24185
  return `${st.mtimeMs}:${st.size}`;
24043
24186
  } catch {
24044
24187
  return "";
@@ -24124,15 +24267,15 @@ function sourceWord(toolName) {
24124
24267
  // src/auth/trusted-recipients.ts
24125
24268
  init_esm_shims();
24126
24269
  init_dist();
24127
- import fs26 from "fs";
24128
- import path28 from "path";
24270
+ import fs27 from "fs";
24271
+ import path29 from "path";
24129
24272
  import os18 from "os";
24130
24273
  function getTrustedRecipientsPath() {
24131
- return path28.join(os18.homedir(), ".node9", "trusted-recipients.json");
24274
+ return path29.join(os18.homedir(), ".node9", "trusted-recipients.json");
24132
24275
  }
24133
24276
  function readTrustedRecipients() {
24134
24277
  try {
24135
- const raw = fs26.readFileSync(getTrustedRecipientsPath(), "utf8");
24278
+ const raw = fs27.readFileSync(getTrustedRecipientsPath(), "utf8");
24136
24279
  const parsed = JSON.parse(raw);
24137
24280
  return Array.isArray(parsed.entries) ? parsed.entries.filter((e) => e && typeof e.value === "string") : [];
24138
24281
  } catch {
@@ -24141,10 +24284,10 @@ function readTrustedRecipients() {
24141
24284
  }
24142
24285
  function writeTrustedRecipients(entries) {
24143
24286
  const filePath = getTrustedRecipientsPath();
24144
- fs26.mkdirSync(path28.dirname(filePath), { recursive: true });
24287
+ fs27.mkdirSync(path29.dirname(filePath), { recursive: true });
24145
24288
  const tmp = filePath + ".node9-tmp";
24146
- fs26.writeFileSync(tmp, JSON.stringify({ entries }, null, 2), { mode: 384 });
24147
- fs26.renameSync(tmp, filePath);
24289
+ fs27.writeFileSync(tmp, JSON.stringify({ entries }, null, 2), { mode: 384 });
24290
+ fs27.renameSync(tmp, filePath);
24148
24291
  }
24149
24292
  function addTrustedRecipient(raw, addedBy = "user") {
24150
24293
  const value = normalizeRecipient(raw);
@@ -24159,7 +24302,7 @@ function addTrustedRecipient(raw, addedBy = "user") {
24159
24302
  var cache6 = null;
24160
24303
  function mtimeOf() {
24161
24304
  try {
24162
- return fs26.statSync(getTrustedRecipientsPath()).mtimeMs;
24305
+ return fs27.statSync(getTrustedRecipientsPath()).mtimeMs;
24163
24306
  } catch {
24164
24307
  return 0;
24165
24308
  }
@@ -24178,9 +24321,9 @@ init_forecast_context();
24178
24321
  // src/auth/cloud.ts
24179
24322
  init_esm_shims();
24180
24323
  init_audit();
24181
- import fs27 from "fs";
24324
+ import fs28 from "fs";
24182
24325
  import os19 from "os";
24183
- import path29 from "path";
24326
+ import path30 from "path";
24184
24327
  init_dist();
24185
24328
  var CLOUD_ARRAY_KEYS = /* @__PURE__ */ new Set(["exposureDestinations", "exposureDestinationHashes"]);
24186
24329
  function maskArgsForCloud(args) {
@@ -24215,7 +24358,7 @@ async function initNode9SaaS(toolName, args, creds, meta, riskMetadata, agentPol
24215
24358
  let ciContext;
24216
24359
  if (process.env.CI) {
24217
24360
  try {
24218
- const ciContextPath = path29.join(os19.homedir(), ".node9", "ci-context.json");
24361
+ const ciContextPath = path30.join(os19.homedir(), ".node9", "ci-context.json");
24219
24362
  const ci = readCappedText(ciContextPath, 1e4);
24220
24363
  if (!ci) throw new Error("ci-context.json unreadable");
24221
24364
  if (ci.truncated) throw new Error("ci-context.json exceeds 10 KB");
@@ -24333,14 +24476,14 @@ async function resolveNode9SaaS(requestId, creds, approved, decidedBy) {
24333
24476
  });
24334
24477
  clearTimeout(timer);
24335
24478
  if (!res.ok) {
24336
- fs27.appendFileSync(
24479
+ fs28.appendFileSync(
24337
24480
  HOOK_DEBUG_LOG,
24338
24481
  `[resolve-cloud] PATCH ${safeMessage(resolveUrl, 200)} \u2192 HTTP ${res.status}
24339
24482
  `
24340
24483
  );
24341
24484
  }
24342
24485
  } catch (err) {
24343
- fs27.appendFileSync(
24486
+ fs28.appendFileSync(
24344
24487
  HOOK_DEBUG_LOG,
24345
24488
  `[resolve-cloud] PATCH failed for ${safeMessage(requestId, 64)}: ${safeMessage(err)}
24346
24489
  `
@@ -24353,16 +24496,16 @@ init_esm_shims();
24353
24496
  init_dist();
24354
24497
  init_forecast_context();
24355
24498
  init_dist();
24356
- import fs28 from "fs";
24357
- import path30 from "path";
24499
+ import fs29 from "fs";
24500
+ import path31 from "path";
24358
24501
  import os20 from "os";
24359
24502
  function loopStateFile() {
24360
- return path30.join(os20.homedir(), ".node9", "loop-state.json");
24503
+ return path31.join(os20.homedir(), ".node9", "loop-state.json");
24361
24504
  }
24362
24505
  function readState() {
24363
24506
  try {
24364
- if (!fs28.existsSync(loopStateFile())) return [];
24365
- const raw = fs28.readFileSync(loopStateFile(), "utf-8");
24507
+ if (!fs29.existsSync(loopStateFile())) return [];
24508
+ const raw = fs29.readFileSync(loopStateFile(), "utf-8");
24366
24509
  const parsed = JSON.parse(raw);
24367
24510
  if (!Array.isArray(parsed)) return [];
24368
24511
  return parsed;
@@ -24371,11 +24514,11 @@ function readState() {
24371
24514
  }
24372
24515
  }
24373
24516
  function writeState(records) {
24374
- const dir2 = path30.dirname(loopStateFile());
24375
- if (!fs28.existsSync(dir2)) fs28.mkdirSync(dir2, { recursive: true });
24517
+ const dir2 = path31.dirname(loopStateFile());
24518
+ if (!fs29.existsSync(dir2)) fs29.mkdirSync(dir2, { recursive: true });
24376
24519
  const tmpPath = `${loopStateFile()}.${os20.hostname()}.${process.pid}.tmp`;
24377
- fs28.writeFileSync(tmpPath, JSON.stringify(records));
24378
- fs28.renameSync(tmpPath, loopStateFile());
24520
+ fs29.writeFileSync(tmpPath, JSON.stringify(records));
24521
+ fs29.renameSync(tmpPath, loopStateFile());
24379
24522
  }
24380
24523
  function recordAndCheck(tool, args, threshold = 3, windowMs = 12e4) {
24381
24524
  try {
@@ -24574,9 +24717,9 @@ function isMcpToolName(toolName) {
24574
24717
  return /^mcp__[^_](?:[^_]|_(?!_))*?__/i.test(toolName);
24575
24718
  }
24576
24719
  function absoluteUploadPath(spelled, cwd) {
24577
- const expanded = spelled === "~" || spelled.startsWith("~/") ? path31.join(os21.homedir(), spelled.slice(1)) : spelled;
24578
- if (path31.isAbsolute(expanded)) return expanded;
24579
- return cwd && path31.isAbsolute(cwd) ? path31.resolve(cwd, expanded) : expanded;
24720
+ const expanded = spelled === "~" || spelled.startsWith("~/") ? path32.join(os21.homedir(), spelled.slice(1)) : spelled;
24721
+ if (path32.isAbsolute(expanded)) return expanded;
24722
+ return cwd && path32.isAbsolute(cwd) ? path32.resolve(cwd, expanded) : expanded;
24580
24723
  }
24581
24724
  function extractFilePaths(toolName, args, shellCommand) {
24582
24725
  const paths = [];
@@ -25122,7 +25265,9 @@ async function _authorizeHeadlessCore(toolName, args, metaArg, options) {
25122
25265
  systemAccessHandled: !isManual && fileAccess.handledPaths.has(filePath)
25123
25266
  }) : null) ?? argumentScan(),
25124
25267
  pii: () => detectArgsPii(args),
25125
- packageCheck: () => packageCheck?.enabled && !isManual ? runPackageCheck(toolName, args, packageCheck, options?.cwd, { offline: !!forecast }) : Promise.resolve(null)
25268
+ packageCheck: () => packageCheck?.enabled && !isManual ? runPackageCheck(toolName, args, packageCheck, options?.cwd, {
25269
+ offline: !!forecast && forecast.onlinePackages !== true
25270
+ }) : Promise.resolve(null)
25126
25271
  });
25127
25272
  const dlpMatch = gates.stop?.dlpMatch ?? gates.reviews.dlp ?? null;
25128
25273
  if (dlpMatch) {