@onlyflows/servicenow-mcp 2.3.0-dev.4 → 2.3.0-dev.5

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.
Files changed (164) hide show
  1. package/CHANGELOG.md +142 -0
  2. package/README.md +111 -5
  3. package/dist/atf-policy.d.ts +1 -1
  4. package/dist/atf-policy.d.ts.map +1 -1
  5. package/dist/atf-policy.js +2 -0
  6. package/dist/atf-policy.js.map +1 -1
  7. package/dist/credential-tables.d.ts +32 -0
  8. package/dist/credential-tables.d.ts.map +1 -0
  9. package/dist/credential-tables.js +58 -0
  10. package/dist/credential-tables.js.map +1 -0
  11. package/dist/encoded-query-policy.d.ts.map +1 -1
  12. package/dist/encoded-query-policy.js +8 -1
  13. package/dist/encoded-query-policy.js.map +1 -1
  14. package/dist/execution-context.d.ts +14 -0
  15. package/dist/execution-context.d.ts.map +1 -1
  16. package/dist/execution-context.js +8 -0
  17. package/dist/execution-context.js.map +1 -1
  18. package/dist/field-policy.d.ts +34 -1
  19. package/dist/field-policy.d.ts.map +1 -1
  20. package/dist/field-policy.js +308 -25
  21. package/dist/field-policy.js.map +1 -1
  22. package/dist/hidden-values.d.ts +225 -0
  23. package/dist/hidden-values.d.ts.map +1 -0
  24. package/dist/hidden-values.js +748 -0
  25. package/dist/hidden-values.js.map +1 -0
  26. package/dist/http-entrypoint.d.ts.map +1 -1
  27. package/dist/http-entrypoint.js +7 -0
  28. package/dist/http-entrypoint.js.map +1 -1
  29. package/dist/index.js +7 -0
  30. package/dist/index.js.map +1 -1
  31. package/dist/metadata-cache.d.ts +38 -0
  32. package/dist/metadata-cache.d.ts.map +1 -1
  33. package/dist/metadata-cache.js +76 -3
  34. package/dist/metadata-cache.js.map +1 -1
  35. package/dist/policy-card.d.ts +16 -1
  36. package/dist/policy-card.d.ts.map +1 -1
  37. package/dist/policy-card.js +13 -2
  38. package/dist/policy-card.js.map +1 -1
  39. package/dist/profile-manager.d.ts +12 -0
  40. package/dist/profile-manager.d.ts.map +1 -1
  41. package/dist/profile-manager.js +23 -1
  42. package/dist/profile-manager.js.map +1 -1
  43. package/dist/setup.d.ts.map +1 -1
  44. package/dist/setup.js +5 -1
  45. package/dist/setup.js.map +1 -1
  46. package/dist/structured-query.d.ts.map +1 -1
  47. package/dist/structured-query.js +6 -1
  48. package/dist/structured-query.js.map +1 -1
  49. package/dist/table-policy.d.ts +34 -1
  50. package/dist/table-policy.d.ts.map +1 -1
  51. package/dist/table-policy.js +95 -10
  52. package/dist/table-policy.js.map +1 -1
  53. package/dist/tool-error.d.ts +8 -1
  54. package/dist/tool-error.d.ts.map +1 -1
  55. package/dist/tool-error.js +23 -0
  56. package/dist/tool-error.js.map +1 -1
  57. package/dist/tool-table-access.d.ts.map +1 -1
  58. package/dist/tool-table-access.js +25 -6
  59. package/dist/tool-table-access.js.map +1 -1
  60. package/dist/tools/aggregate.js +2 -2
  61. package/dist/tools/aggregate.js.map +1 -1
  62. package/dist/tools/all-fields-cap.d.ts.map +1 -1
  63. package/dist/tools/all-fields-cap.js +29 -7
  64. package/dist/tools/all-fields-cap.js.map +1 -1
  65. package/dist/tools/atf-author-module.d.ts +1 -7
  66. package/dist/tools/atf-author-module.d.ts.map +1 -1
  67. package/dist/tools/atf-author-module.js +16 -7
  68. package/dist/tools/atf-author-module.js.map +1 -1
  69. package/dist/tools/atf-contracts.d.ts +69 -4
  70. package/dist/tools/atf-contracts.d.ts.map +1 -1
  71. package/dist/tools/atf-contracts.js +32 -2
  72. package/dist/tools/atf-contracts.js.map +1 -1
  73. package/dist/tools/atf-renderers.js +2 -1
  74. package/dist/tools/atf-renderers.js.map +1 -1
  75. package/dist/tools/atf-results-module.d.ts.map +1 -1
  76. package/dist/tools/atf-results-module.js +5 -3
  77. package/dist/tools/atf-results-module.js.map +1 -1
  78. package/dist/tools/atf-run-module.js +3 -2
  79. package/dist/tools/atf-run-module.js.map +1 -1
  80. package/dist/tools/atf-shared.d.ts +6 -0
  81. package/dist/tools/atf-shared.d.ts.map +1 -1
  82. package/dist/tools/atf-shared.js +49 -10
  83. package/dist/tools/atf-shared.js.map +1 -1
  84. package/dist/tools/atf-step-catalog.d.ts +13 -8
  85. package/dist/tools/atf-step-catalog.d.ts.map +1 -1
  86. package/dist/tools/atf-step-catalog.js +169 -5
  87. package/dist/tools/atf-step-catalog.js.map +1 -1
  88. package/dist/tools/batch.d.ts.map +1 -1
  89. package/dist/tools/batch.js +4 -2
  90. package/dist/tools/batch.js.map +1 -1
  91. package/dist/tools/flow-view-contracts.d.ts +57 -1
  92. package/dist/tools/flow-view-contracts.d.ts.map +1 -1
  93. package/dist/tools/flow-view-contracts.js +34 -2
  94. package/dist/tools/flow-view-contracts.js.map +1 -1
  95. package/dist/tools/flow-view-graph.d.ts +14 -0
  96. package/dist/tools/flow-view-graph.d.ts.map +1 -1
  97. package/dist/tools/flow-view-graph.js +43 -1
  98. package/dist/tools/flow-view-graph.js.map +1 -1
  99. package/dist/tools/flow-view-module.js +1 -1
  100. package/dist/tools/flow-view-module.js.map +1 -1
  101. package/dist/tools/flow-view-policy.d.ts +3 -3
  102. package/dist/tools/flow-view-policy.d.ts.map +1 -1
  103. package/dist/tools/flow-view-policy.js +5 -4
  104. package/dist/tools/flow-view-policy.js.map +1 -1
  105. package/dist/tools/flow-view-renderers.d.ts.map +1 -1
  106. package/dist/tools/flow-view-renderers.js +9 -21
  107. package/dist/tools/flow-view-renderers.js.map +1 -1
  108. package/dist/tools/index.d.ts.map +1 -1
  109. package/dist/tools/index.js +80 -13
  110. package/dist/tools/index.js.map +1 -1
  111. package/dist/tools/platform-view-contracts.d.ts +189 -0
  112. package/dist/tools/platform-view-contracts.d.ts.map +1 -0
  113. package/dist/tools/platform-view-contracts.js +353 -0
  114. package/dist/tools/platform-view-contracts.js.map +1 -0
  115. package/dist/tools/platform-view-evaluate.d.ts +11 -0
  116. package/dist/tools/platform-view-evaluate.d.ts.map +1 -0
  117. package/dist/tools/platform-view-evaluate.js +19 -0
  118. package/dist/tools/platform-view-evaluate.js.map +1 -0
  119. package/dist/tools/platform-view-module.d.ts +28 -0
  120. package/dist/tools/platform-view-module.d.ts.map +1 -0
  121. package/dist/tools/platform-view-module.js +111 -0
  122. package/dist/tools/platform-view-module.js.map +1 -0
  123. package/dist/tools/platform-view-scan.d.ts +57 -0
  124. package/dist/tools/platform-view-scan.d.ts.map +1 -0
  125. package/dist/tools/platform-view-scan.js +375 -0
  126. package/dist/tools/platform-view-scan.js.map +1 -0
  127. package/dist/tools/platform-view-upgrades.d.ts +152 -0
  128. package/dist/tools/platform-view-upgrades.d.ts.map +1 -0
  129. package/dist/tools/platform-view-upgrades.js +545 -0
  130. package/dist/tools/platform-view-upgrades.js.map +1 -0
  131. package/dist/tools/profile.d.ts.map +1 -1
  132. package/dist/tools/profile.js +1 -0
  133. package/dist/tools/profile.js.map +1 -1
  134. package/dist/tools/query-module.js +1 -1
  135. package/dist/tools/query-module.js.map +1 -1
  136. package/dist/tools/record-write-shared.d.ts.map +1 -1
  137. package/dist/tools/record-write-shared.js +4 -3
  138. package/dist/tools/record-write-shared.js.map +1 -1
  139. package/dist/tools/result-envelope.d.ts +116 -36
  140. package/dist/tools/result-envelope.d.ts.map +1 -1
  141. package/dist/tools/result-envelope.js +38 -3
  142. package/dist/tools/result-envelope.js.map +1 -1
  143. package/dist/tools/syslog-cursor.d.ts +61 -0
  144. package/dist/tools/syslog-cursor.d.ts.map +1 -0
  145. package/dist/tools/syslog-cursor.js +146 -0
  146. package/dist/tools/syslog-cursor.js.map +1 -0
  147. package/dist/tools/syslog.d.ts +2 -0
  148. package/dist/tools/syslog.d.ts.map +1 -1
  149. package/dist/tools/syslog.js +126 -2
  150. package/dist/tools/syslog.js.map +1 -1
  151. package/dist/update-set-eval/secret-patterns.d.ts +75 -0
  152. package/dist/update-set-eval/secret-patterns.d.ts.map +1 -0
  153. package/dist/update-set-eval/secret-patterns.js +570 -0
  154. package/dist/update-set-eval/secret-patterns.js.map +1 -0
  155. package/dist/update-set-eval/xml-reader.d.ts +117 -0
  156. package/dist/update-set-eval/xml-reader.d.ts.map +1 -0
  157. package/dist/update-set-eval/xml-reader.js +561 -0
  158. package/dist/update-set-eval/xml-reader.js.map +1 -0
  159. package/dist/version.d.ts +1 -1
  160. package/dist/version.js +1 -1
  161. package/docs/FLOW-VIEW.md +14 -5
  162. package/docs/PRODUCTION-SECURITY.md +63 -0
  163. package/package.json +1 -1
  164. package/server.json +2 -2
package/CHANGELOG.md CHANGED
@@ -5,6 +5,148 @@ All notable changes to this project are documented here.
5
5
  The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [2.3.0-dev.5] — 2026-11-16
9
+
10
+ ### Added
11
+
12
+ - **Read tools now hide `password`/`password2`-typed fields by dictionary type,
13
+ not only by name.** A field whose internal type is `password`, `password2`,
14
+ `masked` or `encrypted_text` is refused when named, left out of `fields=all`,
15
+ detailed and default reads, `"*"` responses and write echoes, refused as a
16
+ filter, order, aggregate, group-by or ATF step-condition field, and refused
17
+ as a write key, whatever it is called. A `sys_properties` row shows `value` only when its
18
+ `type` is a known non-secret type. The types come from one cached
19
+ `sys_dictionary` read per credential. While they cannot be read, field-policy
20
+ tools refuse with a message naming the access needed, unless the profile sets
21
+ `"fieldTypes": { "dictionary": "not_required" }`, which falls back to
22
+ name-only hiding and is flagged on the policy card. `tools/list` is unchanged.
23
+
24
+ - **`sn_syslog` can tail the system log.** `tail: true` returns the newest
25
+ entries, oldest first, with a `cursor`; each later call with `after_cursor`
26
+ returns only the entries created after it, oldest first, with a new `cursor`,
27
+ so a caller no longer re-reads a window and removes duplicates by hand. The
28
+ cursor holds the creation second and the row's `sys_id`, so entries that share
29
+ a second are neither skipped nor repeated, and it is bound to the `level`,
30
+ `source` and `message` filters it was issued for. A malformed, oversized or
31
+ altered cursor, or one used with other filters, is refused with a fixed message
32
+ that never repeats it. When more entries are waiting than `limit` allows (or the
33
+ response is cut to fit its size limit), the call returns `has_more: true` and a
34
+ cursor at the last entry returned. Tail reads never use the metadata cache,
35
+ carry no total count and no `next_offset`, and follow the same table and field
36
+ policy as any `sn_syslog` read; a call without `tail` or `after_cursor` is
37
+ unchanged. A cursor older than the longest `since` window (one year) is refused,
38
+ so a tail cannot reach further back than a plain read. The two new inputs and the `cursor` output add about 340 characters
39
+ to the `sn_syslog` entry in `tools/list`.
40
+
41
+ ### Changed
42
+
43
+ - **`sn_atf_author` checks the table, conditions and ACL setting of ATF steps
44
+ when it adds them.** A `record_query`, `record_validation`,
45
+ `field_values_validation` or `open_existing_record` step needs a read grant on
46
+ the table it names, and an `open_new_form` or `set_field_values` step a write
47
+ grant, with the same refusal as any table access (a named-only table such as
48
+ `sys_audit` must be named). The conditions of `record_query`,
49
+ `record_validation` and `field_values_validation` are checked against the
50
+ table's field policy: a field the profile may not read, a dot-walk (`a.b`), a
51
+ condition that is only a pasted step output, and a term the check does not
52
+ recognise are refused, and only the operators that compare a field with a
53
+ literal are allowed (`=`, `!=`, `<`, `<=`, `>`, `>=`, `LIKE`, `NOT LIKE`,
54
+ `STARTSWITH`, `ENDSWITH`, `IN`, `NOT IN`, `ISEMPTY`, `ISNOTEMPTY`, `BETWEEN`),
55
+ so an operator that takes a second field, such as `SAMEAS` or `GT_FIELD`, is
56
+ refused. `enforce_security: false` is refused on `record_query` and
57
+ `record_validation` with a fixed message (leave it out, or pass `true`; it
58
+ stays `true` by default). A refused step refuses the whole call, before any
59
+ write. A condition value, and a `set_field_values` value, may refer to an earlier
60
+ step's output only by record id or sys_id (`record_id`, `first_record`,
61
+ `sys_id`, `user`), and the fields a
62
+ `set_field_values` step sets must be writable on its table, as for `sn_update`.
63
+ The impersonated user's ACLs still apply on top; suites authored in the
64
+ instance are not checked by the server's table grants, and `atf.execute` stays
65
+ opt-in. The README and `docs/PRODUCTION-SECURITY.md` now also say that a
66
+ database view or extension table over one of the six named-only tables is not
67
+ covered by the name list.
68
+ - **A `"*"` write grant no longer covers `sys_atf_step`, `sys_variable_value`
69
+ and `sys_element_mapping` for the generic write tools.** These tables hold the
70
+ step types, input values and pill mappings that `sn_atf_author` checks when it
71
+ adds a step. Under `"*"`,
72
+ `sn_atf_author` still writes them, but `sn_create`, `sn_update`, `sn_delete`,
73
+ `sn_batch` and attachment uploads reach them only when the profile names the
74
+ table for write; the refusal names the table and the grant that allows it
75
+ (`servicenow-mcp-setup grant --profile <profile> --write sys_atf_step --tools
76
+ sn_update`). Reads are unchanged, and no other table's access changes.
77
+ `sys_variable_value` and `sys_element_mapping` also hold other variables'
78
+ values and mappings (catalog variables, for example), so a profile that writes
79
+ those with the generic tools must now name them. The policy card lists the
80
+ three tables as outside the wildcard row's write access.
81
+ - **`sys_audit` and `sys_journal_field` are no longer covered by a `"*"` table
82
+ grant; name them to read them.** A profile whose `readTables` (or
83
+ `writeTables`) holds `"*"` now reaches them only when it names them. Their rows
84
+ hold the old and new values of other tables' fields, comments and work notes,
85
+ so they are now granted by name only. With `"*"` alone, `sn_query`, `sn_get`,
86
+ `sn_aggregate`, `sn_schema`, `sn_batch` and the other tools refuse them, and
87
+ the message names the table and the grant that allows it:
88
+ `servicenow-mcp-setup grant --profile <profile> --read sys_audit --tools
89
+ sn_query`. A profile that already names a table is unaffected, and a `"*"`
90
+ grant beside the name still covers everything else. A read that names no
91
+ `fields` returns `sys_id`, `tablename`, `documentkey`, `fieldname`, `user` and
92
+ `sys_created_on` for `sys_audit`, and `sys_id`, `name`, `element_id`, `element`,
93
+ `sys_created_by` and `sys_created_on` for `sys_journal_field`; ask for
94
+ `oldvalue`, `newvalue` or `value` by name. No other table's access changes. The
95
+ policy card and the setup wizard's wildcard note say the same.
96
+ - **Four more tables are granted by name only, and a `"*"` field entry now
97
+ narrows all six.** `sys_history_line`, `sys_audit_delete`, `sys_attachment_doc`
98
+ and `sys_email` join `sys_audit` and `sys_journal_field`: a `"*"` table grant no
99
+ longer covers them, for read or write, and a profile reaches one only when
100
+ `tableAccess` names it. Their rows hold history built from audit, deleted
101
+ records, attachment content and email bodies. The refusal names the table and
102
+ the grant that allows it. A read that names no `fields` leaves out the value
103
+ columns (`old`, `new`, `old_value` and `new_value`; `payload`; `data`; `body`,
104
+ `body_text`, `subject`, `recipients`, `copied`, `blind_copied`, `reply_to`,
105
+ `headers` and `error_string`), so ask for them by name. For field policy
106
+ the six belong to the profile, as the ITSM tables do: once a profile names one,
107
+ its `"*"` field entry narrows it, and an entry for the table itself narrows or
108
+ widens it. The 24 system tables, which a `"*"` field entry never narrows, are
109
+ unchanged. `sn_attach` is unaffected: it uses the Attachment API and never
110
+ reads `sys_attachment_doc`.
111
+ A `relatedTables` list that reaches one of the six under a `"*"` grant still
112
+ stops the profile loading, and the message now names the table and says it
113
+ must be granted by name. `sn_profile` reports these tables with the class
114
+ `named_only`.
115
+
116
+ ### Fixed
117
+
118
+ - **`sn_atf_results` with action `get` no longer fails with an internal error on
119
+ a completed suite result whose rows have empty references.** Some result rows
120
+ carry an empty suite reference, and their test results an empty test
121
+ reference. The tool failed on the first one as soon as it had read the result
122
+ (and would have failed on the second), so every completed result of that kind
123
+ failed, while a running one that names its suite worked. Such a result now
124
+ returns normally: the run, its tests and its failures, without a `suite_id`,
125
+ with each test that has no reference identified by its test result's own id,
126
+ and with warnings that say so and that the result has no history or comparison
127
+ (the cache is kept per suite and per test). `run.suiteId` is therefore optional
128
+ in the output schema. A row of the wrong shape (a reference that is not a
129
+ sys_id, an unknown status) now ends the call with an upstream error instead of
130
+ an internal one.
131
+
132
+ - **A client that reads only `structuredContent` no longer loses what the text
133
+ carried.** Some MCP clients give the model the structured result and drop the
134
+ text, and a few tools kept information only in the text. They now carry it as
135
+ typed fields as well, and the text is unchanged. `sn_flow_view` adds `diagram`
136
+ (the Mermaid source, when `format` asks for one), `ref` (the flow record as
137
+ table and sys_id) and `warning_details` (each warning code with its
138
+ explanation). `sn_atf_run` and `sn_atf_results` add `result_ref` (the suite
139
+ result record) and `advice` (how to read a failed step in full).
140
+ `sn_atf_author` adds `advice` after an insert whose outcome could not be
141
+ confirmed; the records it created were already listed with their table and
142
+ sys_id. Record links stay out of `structuredContent`: it names a record by
143
+ table and sys_id, and the instance address stays in the text, so no result
144
+ gains an address. The diagram counts toward `max_response_bytes` and is the first
145
+ thing given up: if the graph and the diagram do not fit together the diagram
146
+ keeps only a note, and its source is never cut short. The published output
147
+ schemas grow by about 1.6 KB in total (1.3%), and the model-visible part of
148
+ `tools/list` by 18 characters.
149
+
8
150
  ## [2.3.0-dev.4] — 2026-11-15
9
151
 
10
152
  ### Changed
package/README.md CHANGED
@@ -756,10 +756,42 @@ in this section is needed to use this server.
756
756
  |------|-------------|
757
757
  | `sn_relationships` | CMDB CI graph traversal — upstream/downstream/both, configurable depth |
758
758
  | `sn_attach` | List attachments, return downloads as inline base64, and upload inline base64 content; never touches a host filesystem path |
759
- | `sn_syslog` | Query system logs with severity/source/time filters |
759
+ | `sn_syslog` | Query system logs with severity/source/time filters, newest first. `tail: true` starts a tail (the newest entries, oldest first, plus a `cursor`); each later call with `after_cursor` returns only the entries after it, oldest first, plus a new `cursor` ([Tailing the system log](#tailing-the-system-log)) |
760
760
  | `sn_codesearch` | Search business rules, script includes, client scripts, etc., with a snippet around each match ([Code search](#code-search)). Part of the default read grant, so a plain read grant on a code table allows it |
761
761
  | `sn_discover` | Discover tables, scoped apps, store apps, plugins |
762
762
 
763
+ #### Tailing the system log
764
+
765
+ `sn_syslog` can follow the log without re-reading it. The first call sends
766
+ `tail: true` and gets the newest `limit` entries (inside the `since` window),
767
+ oldest first, and a `cursor`. Each later call sends that cursor as
768
+ `after_cursor` and gets only the entries created after it, oldest first, and a
769
+ new `cursor`; poll no faster than every few seconds.
770
+
771
+ - **No skips, no repeats.** Many log rows share one `sys_created_on` second, so
772
+ the cursor holds the second and the row's `sys_id`, and a call returns the
773
+ rows after that pair. It is an opaque token: pass it back as given.
774
+ - **`has_more`.** If more than `limit` entries are waiting, the call returns
775
+ `limit` of them with `has_more: true` and a cursor at the last one; call again
776
+ with it. A response cut to fit the byte budget does the same, and the cursor
777
+ always names the last entry actually returned. Tail pages carry no `total` and
778
+ no `next_offset`, and `offset` cannot be combined with a tail.
779
+ - **Same filters on every call.** The cursor is bound to the `level`, `source`
780
+ and `message` it was issued for. A call that changes them is refused (so is a
781
+ malformed, oversized or altered cursor) with a fixed message that does not
782
+ repeat the cursor. `since` applies to the first call only, but a cursor older
783
+ than the longest `since` (525,600 minutes, one year) is refused with a fixed
784
+ message: start a new tail. With nothing to return, the call gives the same
785
+ position back, so keep polling with it. If the first call finds no entries in
786
+ its window it returns no cursor; call it again.
787
+ - **Reads go straight to the instance**, never through the metadata cache, and
788
+ use the same table and field policy as an ordinary `sn_syslog` read. A tail
789
+ also reads `sys_id` and `sys_created_on` to place the cursor, so a field policy
790
+ that withholds either refuses it.
791
+ - **Limits.** Order is by creation second, then `sys_id`. A row the instance
792
+ stores late with a creation time at or before the cursor's second is not seen
793
+ by a tail that has already moved past it.
794
+
763
795
  ### Testing & Automation
764
796
 
765
797
  | Tool | Description |
@@ -1259,8 +1291,8 @@ and must be valid ServiceNow identifiers.
1259
1291
 
1260
1292
  | Variable | Required | Default | Description |
1261
1293
  |----------|----------|---------|-------------|
1262
- | `SN_ALLOWED_READ_TABLES` | ❌ | deny all | Tables permitted for read operations on the explicit `SN_PROFILE_NAME` environment profile only. Use `*` to allow every readable table. |
1263
- | `SN_ALLOWED_WRITE_TABLES` | ❌ | deny all | Tables permitted for create, update, incident journal append, delete, upload, and confirmed batch operations on the explicit `SN_PROFILE_NAME` environment profile only. Use `*` to allow every writable table. Write permission never implies read permission. |
1294
+ | `SN_ALLOWED_READ_TABLES` | ❌ | deny all | Tables permitted for read operations on the explicit `SN_PROFILE_NAME` environment profile only. Use `*` to allow every readable table except `sys_audit`, `sys_journal_field`, `sys_history_line`, `sys_audit_delete`, `sys_attachment_doc` and `sys_email`, which are covered only when named (see [Field policy](#field-policy)). |
1295
+ | `SN_ALLOWED_WRITE_TABLES` | ❌ | deny all | Tables permitted for create, update, incident journal append, delete, upload, and confirmed batch operations on the explicit `SN_PROFILE_NAME` environment profile only. Use `*` to allow every writable table except the same six named-only tables. Write permission never implies read permission. |
1264
1296
  | `SN_TABLE_ACCESS_TARGETS` | Required for exact allowlisted caller-addressable tables; optional with `*` | `[]` | Trusted JSON classification with `table`, exact permitted `tools`, `kind` (`canonical`, `alias`, `view`, or `extension`), literal `closureComplete: true`, and `relatedTables`: the target itself plus any backing or parent tables the operator declares. The loader checks that every related table has the target's operation permission; it does not derive the list from the instance, and the list grants no access. A self-only list is valid for a `canonical` target; `alias`, `view` and `extension` targets must name at least one backing table, and a view or alias should declare every table it reads, because it returns data from each of them whatever the list says. With `*`, omitted target entries use the wildcard operation grant; explicit target entries can still narrow tools and check their related tables. |
1265
1297
  | `SN_FIELD_POLICY_DEFINITIONS` | ❌ | no narrowing | Field policy for the explicit `SN_PROFILE_NAME` environment profile only, like the `SN_ALLOWED_*` variables. **If `~/.servicenow-mcp/config.json` exists, setting this variable stops startup**; give those profiles their own `fieldPolicy` instead. The value is trusted JSON, at most 65,536 characters: either a table map keyed by table name or `*`, the same shape as a profile's `fieldPolicy`, or an object holding the profile keys (`fieldPolicy`, or `readableTableFields` / `writableTableFields`), not both. Each field set is a list of exact field names or `"*"`; `["*"]` means `"*"` in that exact form only, and patterns such as `"u_*"` are rejected. A malformed value stops startup with the key named. Sensitive field names are always denied. See [Field policy](#field-policy). |
1266
1298
  | `SN_ENCODED_QUERY_READ_POLICY` | ❌ | deny all | Trusted JSON object containing bounded `rules` for an exact `sn_query`/table pair. Each rule requires `maxLength`, `maxTerms`, readable `fields`, supported `operators`, `maxLimit`, `maxOffset`, and `maxResponseBytes`. No rule can authorize a write or another tool. |
@@ -1311,7 +1343,23 @@ startup configuration. File-backed profile example:
1311
1343
  `run`/`run-suite` return migration guidance; use `sn_atf_run` with an explicit
1312
1344
  `atf.execute` profile grant. Typed ATF steps use the authenticated native form
1313
1345
  to save and verify inputs and output references without ACL changes or an
1314
- installed application. See [ATF workflow](docs/ATF-WORKFLOW.md).
1346
+ installed application. `sn_atf_author` checks each step that names a table
1347
+ against the profile's grants: a `record_query`, `record_validation`,
1348
+ `field_values_validation` or `open_existing_record` step needs a read grant on its
1349
+ table, and an `open_new_form` or `set_field_values` step a write grant (a
1350
+ named-only table must be named, for either). The conditions of the three steps
1351
+ that have them may use only the operators that compare a field with a literal
1352
+ (`=`, `!=`, `<`, `<=`, `>`, `>=`, `LIKE`, `NOT LIKE`, `STARTSWITH`, `ENDSWITH`,
1353
+ `IN`, `NOT IN`, `ISEMPTY`, `ISNOTEMPTY`, `BETWEEN`), name plain fields the field
1354
+ policy lets the profile read (no dot-walks), and may refer to an earlier step's
1355
+ output only by its record id or sys_id (`record_id`, `first_record`, `sys_id`
1356
+ or `user`), as may the values a `set_field_values` step sets; a refused term
1357
+ refuses the whole call. The fields a `set_field_values` step sets must be
1358
+ writable on its table under the profile's field policy, as for `sn_update`. `record_query` and `record_validation` also refuse
1359
+ `enforce_security: false`; leave it out and it stays `true`. The impersonated
1360
+ user's ACLs still apply on top of all this. Suites authored in the instance are
1361
+ not checked by the server's table grants, and `atf.execute` stays opt-in. See
1362
+ [ATF workflow](docs/ATF-WORKFLOW.md).
1315
1363
 
1316
1364
  #### Field policy
1317
1365
 
@@ -1321,6 +1369,13 @@ denies a table the profile grants. A profile with no field policy may read and
1321
1369
  write every field of a granted table, except that sensitive-looking names
1322
1370
  (`password`, `token`, `secret`, `api_key` and similar) are always denied, and
1323
1371
  the class and domain fields below must be listed before they can be written.
1372
+ Fields of type `password`, `password2`, `masked` or `encrypted_text` are denied
1373
+ the same way, whatever their name, and a `sys_properties` value shows only for
1374
+ a known non-secret `type`. The types come from a cached `sys_dictionary` read,
1375
+ so the integration user needs read access to `sys_dictionary` and
1376
+ `sys_db_object`; without it the tools refuse, unless the profile sets
1377
+ `"fieldTypes": { "dictionary": "not_required" }` to hide by name only (see
1378
+ [Production security](docs/PRODUCTION-SECURITY.md#password-type-fields)).
1324
1379
 
1325
1380
  State it on a profile in `~/.servicenow-mcp/config.json`, beside
1326
1381
  `tableAccess`, in one of two forms. A profile that states both fails to load.
@@ -1409,7 +1464,7 @@ The same policy in the list form:
1409
1464
  }
1410
1465
  ```
1411
1466
 
1412
- **Which tables a `"*"` entry reaches.** Tables fall into three groups:
1467
+ **Which tables a `"*"` entry reaches.** Tables fall into four groups:
1413
1468
 
1414
1469
  - **ITSM tables:** `incident`, `change_request`, `problem`, `sc_request`,
1415
1470
  `sc_req_item`, `sc_task`, `task`, `cmdb_ci`, `cmdb_ci_server`,
@@ -1423,6 +1478,9 @@ The same policy in the list form:
1423
1478
  `sys_atf_test_suite_test`, `sys_atf_test_result`, `sys_atf_step`,
1424
1479
  `sys_element_mapping`, `sys_variable_value`, `sys_atf_test_suite_result`,
1425
1480
  `sys_atf_test_result_step`, `sys_atf_agent`, `syslog`.
1481
+ - **The 6 named-only tables:** `sys_audit`, `sys_journal_field`,
1482
+ `sys_history_line`, `sys_audit_delete`, `sys_attachment_doc`, `sys_email`. A
1483
+ `"*"` entry reaches them once the profile names them in `tableAccess` (below).
1426
1484
 
1427
1485
  On an ITSM table or a table without a built-in entry, named in the policy or
1428
1486
  not, `readable` and `writable` each resolve from the table's own entry, then
@@ -1439,6 +1497,54 @@ client-side code, and the user and group tables (`sys_user`,
1439
1497
  `sys_user_group`, `sys_user_grmember`). Name a system table to narrow it, and
1440
1498
  grant it in `tableAccess` only deliberately.
1441
1499
 
1500
+ **Six tables are granted by name.** A `"*"` entry in `readTables` or
1501
+ `writeTables` covers every other table, but not `sys_audit`, `sys_journal_field`,
1502
+ `sys_history_line`, `sys_audit_delete`, `sys_attachment_doc` or `sys_email`.
1503
+ Their rows hold the old and new values of other tables' fields, comments and
1504
+ work notes, the history built from them, deleted records, attachment content
1505
+ and email bodies. A profile reaches one only when `tableAccess` names it, for
1506
+ example
1507
+ `servicenow-mcp-setup grant --profile <profile> --read sys_audit --tools sn_query`.
1508
+ Without that, every tool refuses it, `sn_query`, `sn_get`, `sn_aggregate`,
1509
+ `sn_schema` and `sn_batch` included, and the message names the table and the
1510
+ grant that allows it. A `relatedTables` list that reaches one of them under a
1511
+ `"*"` grant stops the profile loading, and the message names the table and says
1512
+ to grant it by name.
1513
+
1514
+ Once named, these tables follow the profile's field policy like an ITSM table:
1515
+ a `"*"` field entry narrows them, and an entry for the table narrows or widens
1516
+ them. A read that names no `fields` leaves out the value columns, which are asked
1517
+ for by name: `oldvalue` and `newvalue` for `sys_audit`; `value` for
1518
+ `sys_journal_field`; `old`, `new`, `old_value` and `new_value` for
1519
+ `sys_history_line`; `payload` for `sys_audit_delete`; `data` for
1520
+ `sys_attachment_doc`; and `body`, `body_text`, `subject`, `recipients`,
1521
+ `copied`, `blind_copied`, `reply_to`, `headers` and `error_string` for
1522
+ `sys_email`. `sn_attach` is unchanged: it uses the Attachment API, under the
1523
+ grants for `sys_attachment` and the record's table, and never reads
1524
+ `sys_attachment_doc`.
1525
+
1526
+ **A `"*"` write grant does not cover three ATF tables.** `sys_atf_step`,
1527
+ `sys_variable_value` and `sys_element_mapping` hold the step types, input values
1528
+ and pill mappings that `sn_atf_author` checks when it adds a step. Under a `"*"`
1529
+ write grant they are written by `sn_atf_author` only; `sn_create`, `sn_update`, `sn_delete`, `sn_batch` and
1530
+ attachment uploads reach them only when `tableAccess` names the table for write,
1531
+ and the refusal names the table and the grant that allows it. Reads are
1532
+ unchanged. `sys_variable_value` and `sys_element_mapping` also hold other
1533
+ variables' values and mappings (catalog variables, for example), so a profile
1534
+ that writes those with the generic tools needs to name them.
1535
+
1536
+ **Database views and extension tables are not covered by the name list.** The
1537
+ six tables are matched by table name. A database view built over one of them (a
1538
+ `sys_db_view` that joins any of the six) has a different name, so a `"*"` grant
1539
+ reaches the view and, through it, the columns of the joined table. The same holds
1540
+ for a custom table that extends one of the six. Do not grant such a view or table
1541
+ unless you mean to expose those rows, and on a profile with a `"*"` grant ask
1542
+ your instance administrator to review database views first; a profile with an
1543
+ explicit table list never reaches a view it does not name. To have the loader
1544
+ check it, declare the view as a `view` target with every table it reads in
1545
+ `relatedTables`: the profile then fails to load unless it also names each of
1546
+ those tables (for a named-only table, by name).
1547
+
1442
1548
  **Code tables list without their scripts.** A read of `sys_script`,
1443
1549
  `sys_script_include`, `sys_ui_script`, `sys_script_client` or `sys_ws_operation`
1444
1550
  that names no `fields` returns identifiers and metadata, not the script body, so
@@ -27,7 +27,7 @@ export declare const DENY_ALL_ATF_EXECUTION: AtfExecutionPolicy;
27
27
  * non-boolean value is a provider defect, so it fails context creation.
28
28
  */
29
29
  export declare function createAtfExecutionPolicy(candidate: AtfExecutionPolicyInput | undefined): AtfExecutionPolicy;
30
- export type AtfPolicyFailureReason = "execution_not_enabled" | "script_steps_not_enabled";
30
+ export type AtfPolicyFailureReason = "execution_not_enabled" | "script_steps_not_enabled" | "acl_enforcement_required";
31
31
  export declare class AtfPolicyError extends Error {
32
32
  readonly reason: AtfPolicyFailureReason;
33
33
  constructor(reason: AtfPolicyFailureReason);
@@ -1 +1 @@
1
- {"version":3,"file":"atf-policy.d.ts","sourceRoot":"","sources":["../src/atf-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,wBAAwB,CAAC;AAE/E,0DAA0D;AAC1D,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;CACrC;AAED,0DAA0D;AAC1D,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC;CACpC;AAED,eAAO,MAAM,sBAAsB,EAAE,kBAGnC,CAAC;AAEH;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,uBAAuB,GAAG,SAAS,GAC7C,kB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;gBAE5B,MAAM,EAAE,sBAAsB;CAO3C;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,cAAc,CAMxE;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,cAAc,EACtB,IAAI,CAAC,EAAE,MAAM,GACZ,MAAM,CAYR;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,IAAI,CAAC,gCAAgC,EAAE,KAAK,CAAC,GACpD,IAAI,CAIN"}
@@ -66,6 +66,8 @@ function isAtfPolicyError(error) {
66
66
  function atfPolicyDenialMessage(_error, tool) {
67
67
  if (_error.reason === "script_steps_not_enabled")
68
68
  return "ATF script-step authoring denied by policy. Set atf.allowScriptSteps=true on this profile to permit code-executing steps.";
69
+ if (_error.reason === "acl_enforcement_required")
70
+ return "ATF step denied by policy: record_query and record_validation steps always enforce ACLs. Leave enforce_security out, or set it to true.";
69
71
  const subject = typeof tool === "string" && tool.trim() !== "" ? tool.trim() : "This tool";
70
72
  return (`ATF execution denied by policy: ${subject} runs ATF tests, and this profile ` +
71
73
  `does not enable ATF execution. Running a suite executes its steps on the ` +
@@ -1 +1 @@
1
- {"version":3,"file":"atf-policy.js","sourceRoot":"","sources":["../src/atf-policy.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AA0BH,4DAmBC;AAkBD,4CAMC;AAMD,wDAcC;AAMD,kDAMC;AArFY,QAAA,sBAAsB,GAAuB,MAAM,CAAC,MAAM,CAAC;IACtE,OAAO,EAAE,KAAK;IACd,gBAAgB,EAAE,KAAK;CACxB,CAAC,CAAC;AAEH;;;;GAIG;AACH,SAAgB,wBAAwB,CACtC,SAA8C;IAE9C,IAAI,SAAS,KAAK,SAAS;QAAE,OAAO,8BAAsB,CAAC;IAC3D,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,SAAS,KAAK,IAAI,EAAE,CAAC;QACxD,MAAM,IAAI,SAAS,CAAC,wCAA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qD;IAErD,IAAI,MAAM,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,EAAE,CAAC;QACjC,MAAM,IAAI,cAAc,CAAC,uBAAuB,CAAC,CAAC;IACpD,CAAC;AACH,CAAC"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Tables whose rows are credential material as a whole.
3
+ *
4
+ * A field-type rule hides one column; on these tables the secret is the row:
5
+ * an authentication profile, an OAuth client, a discovery credential, a
6
+ * certificate, a source instance's login, a REST message's auth settings, or
7
+ * a system property whose secrecy is its per-row `type`. A tool that shows
8
+ * values from arbitrary rows (record history, update-set payloads) shows none
9
+ * from these tables, whatever each column's type is.
10
+ *
11
+ * The list is shared and read-only: every tool that needs it imports it from
12
+ * here, so it is decided in one place and tested once. It is matched on the
13
+ * table a field ends at, so a dot-walk through a reference into one of these
14
+ * tables is caught too (see hidden-values.ts).
15
+ *
16
+ * @module credential-tables
17
+ */
18
+ /**
19
+ * Exact names, or a prefix ending in `*` that matches every table whose name
20
+ * starts with it (`sys_auth_profile*` covers `sys_auth_profile_basic`,
21
+ * `sys_auth_profile_oauth2`, ...).
22
+ */
23
+ export declare const CREDENTIAL_TABLE_PATTERNS: readonly string[];
24
+ /** True when `table` is on the credential-table list. A non-name is never one. */
25
+ export declare function isCredentialTable(table: unknown): boolean;
26
+ /**
27
+ * True when `table` or any table in its extension chain is on the list. The
28
+ * chain is the table first, then its ancestors (`ssh_credentials` extends
29
+ * `discovery_credentials`).
30
+ */
31
+ export declare function isCredentialTableHierarchy(hierarchy: readonly string[]): boolean;
32
+ //# sourceMappingURL=credential-tables.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credential-tables.d.ts","sourceRoot":"","sources":["../src/credential-tables.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,EAAE,SAAS,MAAM,EASrD,CAAC;AAEH,kFAAkF;AAClF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CASzD;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAEhF"}
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ /**
3
+ * Tables whose rows are credential material as a whole.
4
+ *
5
+ * A field-type rule hides one column; on these tables the secret is the row:
6
+ * an authentication profile, an OAuth client, a discovery credential, a
7
+ * certificate, a source instance's login, a REST message's auth settings, or
8
+ * a system property whose secrecy is its per-row `type`. A tool that shows
9
+ * values from arbitrary rows (record history, update-set payloads) shows none
10
+ * from these tables, whatever each column's type is.
11
+ *
12
+ * The list is shared and read-only: every tool that needs it imports it from
13
+ * here, so it is decided in one place and tested once. It is matched on the
14
+ * table a field ends at, so a dot-walk through a reference into one of these
15
+ * tables is caught too (see hidden-values.ts).
16
+ *
17
+ * @module credential-tables
18
+ */
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.CREDENTIAL_TABLE_PATTERNS = void 0;
21
+ exports.isCredentialTable = isCredentialTable;
22
+ exports.isCredentialTableHierarchy = isCredentialTableHierarchy;
23
+ const TABLE_NAME = /^[a-z][a-z0-9_]{0,79}$/u;
24
+ /**
25
+ * Exact names, or a prefix ending in `*` that matches every table whose name
26
+ * starts with it (`sys_auth_profile*` covers `sys_auth_profile_basic`,
27
+ * `sys_auth_profile_oauth2`, ...).
28
+ */
29
+ exports.CREDENTIAL_TABLE_PATTERNS = Object.freeze([
30
+ "sys_properties",
31
+ "sys_auth_profile*",
32
+ "oauth_entity",
33
+ "oauth_credential",
34
+ "discovery_credentials",
35
+ "sys_certificate",
36
+ "sys_update_set_source",
37
+ "sys_rest_message*",
38
+ ]);
39
+ /** True when `table` is on the credential-table list. A non-name is never one. */
40
+ function isCredentialTable(table) {
41
+ if (typeof table !== "string")
42
+ return false;
43
+ const normalized = table.trim().toLowerCase();
44
+ if (!TABLE_NAME.test(normalized))
45
+ return false;
46
+ return exports.CREDENTIAL_TABLE_PATTERNS.some((pattern) => pattern.endsWith("*")
47
+ ? normalized.startsWith(pattern.slice(0, -1))
48
+ : normalized === pattern);
49
+ }
50
+ /**
51
+ * True when `table` or any table in its extension chain is on the list. The
52
+ * chain is the table first, then its ancestors (`ssh_credentials` extends
53
+ * `discovery_credentials`).
54
+ */
55
+ function isCredentialTableHierarchy(hierarchy) {
56
+ return hierarchy.some(isCredentialTable);
57
+ }
58
+ //# sourceMappingURL=credential-tables.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credential-tables.js","sourceRoot":"","sources":["../src/credential-tables.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;AAqBH,8CASC;AAOD,gEAEC;AArCD,MAAM,UAAU,GAAG,yBAAyB,CAAC;AAE7C;;;;GAIG;AACU,QAAA,yBAAyB,GAAsB,MAAM,CAAC,MAAM,CAAC;IACxE,gBAAgB;IAChB,mBAAmB;IACnB,cAAc;IACd,kBAAkB;IAClB,uBAAuB;IACvB,iBAAiB;IACjB,uBAAuB;IACvB,mBAAmB;CACpB,CAAC,CAAC;AAEH,kFAAkF;AAClF,SAAgB,iBAAiB,CAAC,KAAc;IAC9C,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5C,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC9C,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC;QAAE,OAAO,KAAK,CAAC;IAC/C,OAAO,iCAAyB,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAChD,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC;QACnB,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC7C,CAAC,CAAC,UAAU,KAAK,OAAO,CAC3B,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,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,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC;IACnC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,8EAA8E;IAC9E,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;CAChC;AAED,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IACzC,2EAA2E;IAC3E,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;CACnC;AAYD,iFAAiF;AACjF,wBAAgB,8BAA8B,CAC5C,KAAK,GAAE,6BAAkC,GACxC,wBAAwB,CA0B1B;AAED,gFAAgF;AAChF,wBAAgB,uCAAuC,CACrD,WAAW,GAAE,MAAM,CAAC,UAAwB,GAC3C,wBAAwB,CAgB1B;AAED,0EAA0E;AAC1E,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,qBAAqB,GAC7B,4BAA4B,CA8B9B;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,OAAO,EACf,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,OAAO,GACb,MAAM,GAAG,SAAS,CAUpB;AAED,8DAA8D;AAC9D,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAI1D;AAED,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,uBAAuB,CAMlC"}
@@ -130,9 +130,16 @@ function authorizeRawEncodedRead(policy, request) {
130
130
  if (tool !== "sn_query") {
131
131
  throw new EncodedQueryPolicyError("read_not_approved");
132
132
  }
133
- const rule = policy.rules.find((candidate) => candidate.tool === tool && candidate.table === table);
133
+ let rule = policy.rules.find((candidate) => candidate.tool === tool && candidate.table === table);
134
134
  if (!rule)
135
135
  throw new EncodedQueryPolicyError("read_not_approved");
136
+ // The rule's fields were checked by name when the policy was built. In a
137
+ // dispatched call a hidden-typed field (or sys_properties.value) is also
138
+ // taken out, so a rule cannot filter, order or return one.
139
+ const denied = (0, field_policy_js_1.queryDeniedFields)(table);
140
+ if (denied.size > 0) {
141
+ rule = { ...rule, fields: rule.fields.filter((field) => !denied.has(field)) };
142
+ }
136
143
  enforceResultBounds(rule, request);
137
144
  validateOrderBy(rule, request.orderBy);
138
145
  const outputFields = validateOutputFields(rule, request.outputFields);
@@ -1 +1 @@
1
- {"version":3,"file":"encoded-query-policy.js","sourceRoot":"","sources":["../src/encoded-query-policy.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;AA4HH,wEA4BC;AAGD,0FAkBC;AAGD,0DA0BC;AAQD,wDAcC;AAGD,sDAIC;AAED,8DAQC;AA/OD,6CAAqC;AACrC,yCAAmD;AAEnD,uDAA0D;AAC1D,uDAAuD;AAE1C,QAAA,8BAA8B,GAAG,EAAE,CAAC;AACpC,QAAA,+BAA+B,GAAG,EAAE,CAAC;AACrC,QAAA,wBAAwB,GAAG,KAAK,CAAC;AACjC,QAAA,uBAAuB,GAAG,EAAE,CAAC;AAC7B,QAAA,4BAA4B,GAAG,EAAE,CAAC;AAClC,QAAA,wBAAwB,GAAG,SAAS,CAAC;AACrC,QAAA,wBAAwB,GAAG,8BAA8B,CAAC;AAE1D,QAAA,+BAA+B,GAC1C,0FAA0F,CAAC;AAE7F;;;;;GAKG;AACU,QAAA,kCAAkC,GAAG,MAAM,CAAC,MAAM,CAAC;IAC9D,KAAK,EAAE,CAAC,KAAiC,EAAsB,EAAE,CAC/D,KAAK,CAAC,IAAI,KAAK,mBAAmB,CAAC,CAAC,CAAC,uCAA+B,CAAC,CAAC,CAAC,SAAS;CACnF,CAAC,CAAC;AAEU,QAAA,iCAAiC,GAAG,MAAM,CAAC,MAAM,CAAC;IAC7D,GAAG;IACH,IAAI;IACJ,GAAG;IACH,IAAI;IACJ,GAAG;IACH,IAAI;IAC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,CAAC,aAAa,CAAC,SAAS,CAAC;QAChC,SAAS,GAAG,OAAO;QACnB,SAAS,GAAG,OAAO,EACnB,CAAC;QACD,MAAM,IAAI,SAAS,CAAC,uCAAuC,CAAC,CAAC;IAC/D,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -10,6 +10,7 @@
10
10
  * @module execution-context
11
11
  */
12
12
  import { type AtfExecutionPolicy, type AtfExecutionPolicyInput } from "./atf-policy.js";
13
+ import { type DictionaryRequirement, type FieldTypeLoader, type FieldTypesConfigInput } from "./hidden-values.js";
13
14
  import type { FieldPolicyConfigurationInput } from "./field-policy.js";
14
15
  import { type EncodedQueryAccessPolicy, type EncodedQueryAccessPolicyInput } from "./encoded-query-policy.js";
15
16
  import { type TableAccessPolicy } from "./table-policy.js";
@@ -54,6 +55,8 @@ export interface EffectivePolicyReference {
54
55
  readonly encodedQueryAccess?: EncodedQueryAccessPolicyInput;
55
56
  /** Omission denies ATF execution and script-step authoring. */
56
57
  readonly atf?: AtfExecutionPolicyInput;
58
+ /** Omission requires the field types (see hidden-values.ts). */
59
+ readonly fieldTypes?: FieldTypesConfigInput;
57
60
  }
58
61
  export interface ResolvedEffectivePolicyReference {
59
62
  readonly id: string;
@@ -62,6 +65,9 @@ export interface ResolvedEffectivePolicyReference {
62
65
  readonly fieldPolicy?: FieldPolicyConfigurationInput;
63
66
  readonly encodedQueryAccess: EncodedQueryAccessPolicy;
64
67
  readonly atf: AtfExecutionPolicy;
68
+ readonly fieldTypes: {
69
+ readonly dictionary: DictionaryRequirement;
70
+ };
65
71
  }
66
72
  /** Injectable policy-selection port; it does not itself authorize a tool. */
67
73
  export interface EffectivePolicyProvider {
@@ -172,6 +178,14 @@ export interface ExecutionContextDependencies {
172
178
  readonly toolAuditObserver?: ToolAuditObserver;
173
179
  /** Runtime request signal; omission is a non-cancellable local/test invocation. */
174
180
  readonly requestSignal?: AbortSignal;
181
+ /**
182
+ * Replaces the field-type lookup (`loadFieldTypes`) for a test double that
183
+ * does not serve it. Only code that builds these dependencies can set it:
184
+ * no profile, configuration key or environment variable reaches it, and
185
+ * the production entry points never do. Omitted, the real lookup runs for
186
+ * every tool with field policies.
187
+ */
188
+ readonly fieldTypeLoader?: FieldTypeLoader;
175
189
  }
176
190
  /** Validate, clone, and deeply freeze runtime-provided request metadata. */
177
191
  export declare function immutableRequestMetadata(candidate: RequestMetadata): RequestMetadata;