banking-agent-audit 0.1.4__tar.gz
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.
- banking_agent_audit-0.1.4/LICENSE-APACHE +202 -0
- banking_agent_audit-0.1.4/LICENSE-MIT +21 -0
- banking_agent_audit-0.1.4/PKG-INFO +329 -0
- banking_agent_audit-0.1.4/README.md +289 -0
- banking_agent_audit-0.1.4/pyproject.toml +121 -0
- banking_agent_audit-0.1.4/setup.cfg +4 -0
- banking_agent_audit-0.1.4/src/banking_agent_audit/__init__.py +31 -0
- banking_agent_audit-0.1.4/src/banking_agent_audit/cli.py +51 -0
- banking_agent_audit-0.1.4/src/banking_agent_audit/governance/__init__.py +119 -0
- banking_agent_audit-0.1.4/src/banking_agent_audit/governance/adverse_action_gate.py +215 -0
- banking_agent_audit-0.1.4/src/banking_agent_audit/governance/audit_chain.py +317 -0
- banking_agent_audit-0.1.4/src/banking_agent_audit/governance/autonomy_ladder.py +190 -0
- banking_agent_audit-0.1.4/src/banking_agent_audit/governance/defcon.py +212 -0
- banking_agent_audit-0.1.4/src/banking_agent_audit/governance/effective_challenge_harness.py +268 -0
- banking_agent_audit-0.1.4/src/banking_agent_audit/governance/model_risk_management.py +148 -0
- banking_agent_audit-0.1.4/src/banking_agent_audit/governance/sanctions_workflow.py +263 -0
- banking_agent_audit-0.1.4/src/banking_agent_audit/governance/sovereign_veto.py +259 -0
- banking_agent_audit-0.1.4/src/banking_agent_audit/obligation_map.py +129 -0
- banking_agent_audit-0.1.4/src/banking_agent_audit/py.typed +0 -0
- banking_agent_audit-0.1.4/src/banking_agent_audit/reference_adapters.py +132 -0
- banking_agent_audit-0.1.4/src/banking_agent_audit/schemas/__init__.py +17 -0
- banking_agent_audit-0.1.4/src/banking_agent_audit/schemas/audit_event.py +199 -0
- banking_agent_audit-0.1.4/src/banking_agent_audit.egg-info/PKG-INFO +329 -0
- banking_agent_audit-0.1.4/src/banking_agent_audit.egg-info/SOURCES.txt +38 -0
- banking_agent_audit-0.1.4/src/banking_agent_audit.egg-info/dependency_links.txt +1 -0
- banking_agent_audit-0.1.4/src/banking_agent_audit.egg-info/entry_points.txt +2 -0
- banking_agent_audit-0.1.4/src/banking_agent_audit.egg-info/requires.txt +14 -0
- banking_agent_audit-0.1.4/src/banking_agent_audit.egg-info/top_level.txt +1 -0
- banking_agent_audit-0.1.4/tests/test_adverse_action_gate.py +112 -0
- banking_agent_audit-0.1.4/tests/test_audit_chain.py +217 -0
- banking_agent_audit-0.1.4/tests/test_audit_event.py +70 -0
- banking_agent_audit-0.1.4/tests/test_autonomy_ladder.py +160 -0
- banking_agent_audit-0.1.4/tests/test_cli.py +39 -0
- banking_agent_audit-0.1.4/tests/test_defcon.py +131 -0
- banking_agent_audit-0.1.4/tests/test_effective_challenge.py +199 -0
- banking_agent_audit-0.1.4/tests/test_model_risk_management.py +84 -0
- banking_agent_audit-0.1.4/tests/test_obligation_map.py +48 -0
- banking_agent_audit-0.1.4/tests/test_reference_adapters.py +99 -0
- banking_agent_audit-0.1.4/tests/test_sanctions_workflow.py +122 -0
- banking_agent_audit-0.1.4/tests/test_sovereign_veto.py +103 -0
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Kunjar Bhaduri
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: banking-agent-audit
|
|
3
|
+
Version: 0.1.4
|
|
4
|
+
Summary: Governance patterns for autonomous AI agents in regulated banking
|
|
5
|
+
Author-email: Kunjar Bhaduri <130852583+linus10x@users.noreply.github.com>
|
|
6
|
+
License: MIT OR Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/linus10x/banking-agent-audit
|
|
8
|
+
Project-URL: Repository, https://github.com/linus10x/banking-agent-audit
|
|
9
|
+
Project-URL: Issues, https://github.com/linus10x/banking-agent-audit/issues
|
|
10
|
+
Project-URL: Changelog, https://github.com/linus10x/banking-agent-audit/blob/main/CHANGELOG.md
|
|
11
|
+
Keywords: ai-governance,autonomous-agents,banking,model-risk-management,regulated-ai,audit-trail,fair-lending,adverse-action,bsa-aml,human-in-the-loop
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Intended Audience :: Financial and Insurance Industry
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Topic :: Office/Business :: Financial
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
22
|
+
Classifier: Topic :: Security
|
|
23
|
+
Classifier: Typing :: Typed
|
|
24
|
+
Requires-Python: >=3.12
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
License-File: LICENSE-APACHE
|
|
27
|
+
License-File: LICENSE-MIT
|
|
28
|
+
Provides-Extra: dev
|
|
29
|
+
Requires-Dist: pytest>=8.3; extra == "dev"
|
|
30
|
+
Requires-Dist: pytest-cov>=6.0; extra == "dev"
|
|
31
|
+
Requires-Dist: mypy>=1.14; extra == "dev"
|
|
32
|
+
Requires-Dist: ruff>=0.8; extra == "dev"
|
|
33
|
+
Requires-Dist: pre-commit>=3.7; extra == "dev"
|
|
34
|
+
Provides-Extra: test-property
|
|
35
|
+
Requires-Dist: hypothesis>=6.115; extra == "test-property"
|
|
36
|
+
Provides-Extra: security-dev
|
|
37
|
+
Requires-Dist: bandit[toml]>=1.7; extra == "security-dev"
|
|
38
|
+
Requires-Dist: pip-audit>=2.7; extra == "security-dev"
|
|
39
|
+
Dynamic: license-file
|
|
40
|
+
|
|
41
|
+
# banking-agent-audit
|
|
42
|
+
|
|
43
|
+
Governance patterns for autonomous AI agents in regulated banking: five corrected primitives + tested model-risk effective-challenge & ECOA/Reg B adverse-action controls + a no-bundled-list sanctions workflow. Reference IP — MIT/Apache-2.0.
|
|
44
|
+
|
|
45
|
+
[](https://github.com/linus10x/banking-agent-audit/actions/workflows/ci.yml)
|
|
46
|
+

|
|
47
|
+

|
|
48
|
+

|
|
49
|
+

|
|
50
|
+
[](https://doi.org/10.5281/zenodo.20564584)
|
|
51
|
+
[](https://github.com/linus10x/autonomy-ladder-libraries)
|
|
52
|
+
|
|
53
|
+
> **What this is:** a reference governance library that encodes ECOA / Reg B adverse-action, model-risk effective-challenge, and OFAC/BSA controls an autonomous banking agent must operate under, as runnable, tested checks.
|
|
54
|
+
> **What this is not:** reference IP for adoption, not a control deployed inside a bank today — verify every citation against its primary source and qualified counsel.
|
|
55
|
+
> **Who this is for:** a bank's model-risk, fair-lending, or compliance lead standing up AI/agentic decisioning — or a lab / cloud FSI applied lead who needs a falsifiable governance baseline.
|
|
56
|
+
|
|
57
|
+
## 30-second tour
|
|
58
|
+
|
|
59
|
+
- **Vertical:** banking — model risk · ECOA/Reg B adverse action · BSA/AML/OFAC.
|
|
60
|
+
- **Decision classes encoded:** ECOA/Reg B §1002.9 adverse-action notice (+ FCRA §615 overlay) and model-risk effective-challenge — both **implemented and tested**; a sanctions disposition workflow that ships **no list**.
|
|
61
|
+
- **Primary rule cites:** ECOA / Reg B **12 CFR §1002.9** · FCRA §615 **15 U.S.C. §1681m** · BSA **31 U.S.C. §5318(h)/(g)** · OFAC **31 CFR Ch. V** · 2026 revised interagency Model Risk Management guidance (OCC Bulletin 2026-13).
|
|
62
|
+
- **Assurance:** 182 tests · ~99% coverage (≥90% gate) · 13/13 mutation kill · zero runtime deps · `mypy --strict`.
|
|
63
|
+
- **Golden corpus:** real CFPB / DOJ / FinCEN matters — **Trustmark, City National, Trident Mortgage, Washington Trust, Citibank, Fifth Third, Townstone, TD Bank**.
|
|
64
|
+
|
|
65
|
+
## Read me first
|
|
66
|
+
|
|
67
|
+
1. [`tests/test_adverse_action_gate.py`](tests/test_adverse_action_gate.py) — the single best illustrative test: the ECOA/Reg B adverse-action gate turned into runnable checks.
|
|
68
|
+
2. [`WORKED_EXAMPLE.md`](WORKED_EXAMPLE.md) — one concrete adverse-action flow, end to end (with a runnable companion script).
|
|
69
|
+
3. The framework: [autonomy-ladder.io](https://autonomy-ladder.io) — and [`AUTONOMY_LADDER.md`](AUTONOMY_LADDER.md) for how this library's primitives map to the A0→A4 rungs.
|
|
70
|
+
|
|
71
|
+
## Install
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
git clone https://github.com/linus10x/banking-agent-audit && cd banking-agent-audit
|
|
75
|
+
pip install -e .
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Why this exists for frontier autonomy stacks
|
|
81
|
+
|
|
82
|
+
The controls in this library are **domain-agnostic**. The DEFCON state machine, the non-overridable **sovereign veto** (a separate-process control the agent cannot switch off), the **hash-chain audit ledger** (it detects tampering within its trust boundary), the **hard envelopes with mechanical escalation**, the **sampled-review tripwires**, and **monitor-led promotion** were forged in real multi-agent production systems under consequence — and they apply directly to any high-stakes coordinated autonomy (vehicles, robots, agent swarms) where *invisible promotion* or *cascade failure* is unacceptable. The decision class is a parameter: this repo encodes it for **banking — model risk, ECOA/Reg B adverse action, BSA/AML/OFAC**, but the same A0→A4 deployment-authority structure lifts into any decision class without inheriting financial-services assumptions.
|
|
83
|
+
|
|
84
|
+
- **Framework + whitepaper:** [autonomy-ladder.io](https://autonomy-ladder.io)
|
|
85
|
+
- **Non-financial demo (under 60s):** [`finserv-agent-audit/examples/agent_coordination`](https://github.com/linus10x/finserv-agent-audit/tree/main/examples/agent_coordination) — the same veto / envelope / audit-chain / demotion primitives on a generic agent swarm.
|
|
86
|
+
|
|
87
|
+
> **For reviewers & safety teams:** every control here is falsifiable — the test suite (182 tests · 13/13 mutation kill · zero runtime deps) turns each rule into a runnable check, and the veto and ledger are infrastructure with operational properties (separate process boundary, distinct credentials, a gate the agent cannot reach; write-once retention). These are reference implementations for adoption, not deployed production controls.
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
## Part of the Autonomy Ladder™ family
|
|
91
|
+
|
|
92
|
+
Six co-equal regulated-vertical reference libraries implementing the **Autonomy Ladder** — a governance framework for autonomous AI in regulated operations (A0→A4, every rung demotable). **Framework + whitepaper: [autonomy-ladder.io](https://autonomy-ladder.io).**
|
|
93
|
+
|
|
94
|
+
| Vertical | Library |
|
|
95
|
+
|---|---|
|
|
96
|
+
| Cross-vertical financial services | [`finserv-agent-audit`](https://github.com/linus10x/finserv-agent-audit) |
|
|
97
|
+
| Banking (model risk · ECOA/Reg B · BSA/AML/OFAC) | **[`banking-agent-audit`](https://github.com/linus10x/banking-agent-audit)** |
|
|
98
|
+
| Payments (OFAC · Reg E · rail finality) | [`payments-agent-audit`](https://github.com/linus10x/payments-agent-audit) |
|
|
99
|
+
| Health-insurance payer (UM · prior auth · appeals) | [`payer-agent-audit`](https://github.com/linus10x/payer-agent-audit) |
|
|
100
|
+
| SEC-registered investment advisers (Advisers Act §206) | [`private-capital-agent-audit`](https://github.com/linus10x/private-capital-agent-audit) |
|
|
101
|
+
| Commercial real estate | [`cre-agent-audit`](https://github.com/linus10x/cre-agent-audit) |
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## What this is — and what it is not
|
|
106
|
+
|
|
107
|
+
This library is **reference IP for adoption**, not a control operating inside a
|
|
108
|
+
bank today. Read the claim layer before you cite it:
|
|
109
|
+
|
|
110
|
+
| Surface | Claim |
|
|
111
|
+
|---|---|
|
|
112
|
+
| The five primitives (level-gate, sovereign veto, hash-chain ledger, DEFCON, effective challenge) | **Real, tested reference patterns** — within-trust-boundary tamper *evidence*, not a deployed G-SIB control wrapped in an org assurance apparatus. |
|
|
113
|
+
| Model-risk effective-challenge control | **Implemented and tested.** Gates a model's validation status on attested challenger independence. |
|
|
114
|
+
| ECOA / Reg B §1002.9 adverse-action gate | **Implemented and tested.** Validates notice structure, timing, specific-reason content, and the FCRA §615 overlay. |
|
|
115
|
+
| OFAC / sanctions screening | **A reference disposition *workflow* pattern only.** It ships **no sanctions list**; the list source is a pluggable seam labeled `UNWIRED-BY-DEPLOYER`. It is **not** an operating OFAC control. |
|
|
116
|
+
| HMDA, TILA/Reg Z, deposit/fraud, AVM QC | **Documented patterns** — described and mapped to primary sources, not enforced in code at 0.1.0. |
|
|
117
|
+
|
|
118
|
+
Every statutory citation below is cited to a primary source or marked `UNVERIFIED`.
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## Disclaimer
|
|
123
|
+
|
|
124
|
+
This software and its documentation are provided for **reference and educational
|
|
125
|
+
purposes only**. They are **not legal, compliance, or regulatory advice**, do not
|
|
126
|
+
create an attorney–client relationship, and are not a substitute for a bank's
|
|
127
|
+
model-risk framework, its compliance program, or qualified counsel. Nothing here
|
|
128
|
+
**guarantees compliance** with the Bank Secrecy Act, ECOA / Regulation B, FCRA,
|
|
129
|
+
HMDA, TILA, Regulation E, OFAC sanctions programs, model-risk guidance, or any
|
|
130
|
+
other law or regulation. Statutory citations may be incomplete or become out of
|
|
131
|
+
date; **verify every citation against the primary source and qualified counsel**
|
|
132
|
+
before relying on it. Supervisory guidance referenced here is non-enforceable and
|
|
133
|
+
subject to revision — confirm it is current. The software is provided **"AS IS",
|
|
134
|
+
WITHOUT WARRANTY OF ANY KIND**, express or implied, and the author disclaims all
|
|
135
|
+
liability for any use. See [`LICENSE-MIT`](LICENSE-MIT) / [`LICENSE-APACHE`](LICENSE-APACHE).
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## Quick start
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
pip install -e ".[dev,test-property]"
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
```python
|
|
146
|
+
from banking_agent_audit.governance import (
|
|
147
|
+
AuditChain, SovereignVeto, AdverseActionGate, ModelRiskManagement,
|
|
148
|
+
)
|
|
149
|
+
from banking_agent_audit.governance.adverse_action_gate import (
|
|
150
|
+
AdverseActionDecision, AdverseActionType,
|
|
151
|
+
)
|
|
152
|
+
|
|
153
|
+
# A tamper-evident, deployer-keyed audit ledger.
|
|
154
|
+
chain = AuditChain(deployer_id="example-bank", mode="advisory")
|
|
155
|
+
|
|
156
|
+
# An ECOA / Reg B §1002.9 adverse-action check.
|
|
157
|
+
gate = AdverseActionGate(audit_chain=chain)
|
|
158
|
+
result = gate.evaluate(AdverseActionDecision(
|
|
159
|
+
applicant_id="app-001",
|
|
160
|
+
action_type=AdverseActionType.DENIAL,
|
|
161
|
+
principal_reasons=("debt-to-income ratio 0.62 exceeds the 0.43 product limit",),
|
|
162
|
+
notice_provided=True,
|
|
163
|
+
days_to_notice=12,
|
|
164
|
+
used_consumer_report=True,
|
|
165
|
+
cra_name_provided=True,
|
|
166
|
+
credit_score_disclosed=True,
|
|
167
|
+
applicant_rights_disclosed=True,
|
|
168
|
+
))
|
|
169
|
+
print(result.compliant, result.citations)
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
CLI:
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
banking-audit claims # print the obligation claim sheet
|
|
176
|
+
banking-audit verify audit.jsonl # verify a JSONL audit ledger
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## The five primitives (corrected standard)
|
|
182
|
+
|
|
183
|
+
1. **Level-gate (A0→A4)** — refuses promotion when a lower rung's controls are
|
|
184
|
+
unmet and requires **independent attestation** of its inputs, not
|
|
185
|
+
caller-asserted booleans. Advisory by default and labeled as such; a strict
|
|
186
|
+
`production` mode fails closed without a verifier.
|
|
187
|
+
2. **Sovereign veto** — a fail-closed kill switch. In `production` mode a wired
|
|
188
|
+
authorizer is mandatory; clearing a veto requires an **authenticated**
|
|
189
|
+
non-agent principal, and **an agent cannot clear its own veto**.
|
|
190
|
+
3. **Hash-chain ledger** — `verify()` / `verify_strict()` **branch the genesis
|
|
191
|
+
seed** so a deployer-keyed (hardened) chain and a legacy chain both verify
|
|
192
|
+
true. End-to-end regeneration is detectable via an external **witness anchor**
|
|
193
|
+
that is non-optional in `production` mode.
|
|
194
|
+
4. **DEFCON state machine** — escalates immediately on a risk breach; **never
|
|
195
|
+
auto-de-escalates**. Lowering the level requires the manual-override +
|
|
196
|
+
authorizer path and may move only **one level at a time** (no one-call
|
|
197
|
+
`HALT → NORMAL`).
|
|
198
|
+
5. **Effective challenge** — rejects `challenger == primary` in code and records
|
|
199
|
+
an operator **independence attestation**; a model owner cannot self-challenge
|
|
200
|
+
to a clean `accept_primary`.
|
|
201
|
+
|
|
202
|
+
These are built to the corrected standard directly — not copied from a sibling
|
|
203
|
+
library's source.
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## Banking controls and sub-vertical coverage
|
|
208
|
+
|
|
209
|
+
| Obligation | Sub-vertical | Claim layer | Primary source |
|
|
210
|
+
|---|---|---|---|
|
|
211
|
+
| Model validation via effective challenge | Capital-markets / model risk | **Implemented** | OCC Bulletin 2026-13 (2026 revised MRM guidance; verified as of June 2026) |
|
|
212
|
+
| ECOA / Reg B §1002.9 adverse-action notice + FCRA §615 | Consumer credit | **Implemented** | 12 CFR §1002.9; 15 U.S.C. §1681m |
|
|
213
|
+
| Sanctions / AML disposition workflow (no bundled list) | AML / sanctions | **Deployer-wired pattern** | 31 U.S.C. §5318(h)/(g); 31 CFR Ch. X (BSA), Ch. V (OFAC) |
|
|
214
|
+
| HMDA / Reg C loan-level disclosure | Mortgage | Documented pattern | 12 CFR Part 1003 |
|
|
215
|
+
| TILA / Reg Z consumer-credit disclosure | Consumer credit | Documented pattern | 12 CFR Part 1026 |
|
|
216
|
+
| Reg E / EFTA error resolution + unauthorized-EFT liability | Deposit / payments / fraud | Documented pattern | 12 CFR Part 1005 |
|
|
217
|
+
| Interagency AVM quality-control standards | Mortgage | Documented pattern | Interagency AVM rule (2024) |
|
|
218
|
+
|
|
219
|
+
Regulators in scope: Federal Reserve · OCC · FDIC · CFPB (consumer credit) ·
|
|
220
|
+
FinCEN and OFAC (AML/sanctions). The model-risk concept of **effective
|
|
221
|
+
challenge** crystallized in SR 11-7 (rescinded 2026-04-17; verified as of
|
|
222
|
+
June 2026) and is carried
|
|
223
|
+
forward in principle under the 2026 revised interagency Model Risk Management
|
|
224
|
+
guidance; that guidance states generative and agentic AI models are not within
|
|
225
|
+
its scope, so deployers of such models demonstrate bounded operation through
|
|
226
|
+
their own frameworks. See [`docs/regulatory/`](docs/regulatory/) for the
|
|
227
|
+
per-obligation mappings.
|
|
228
|
+
|
|
229
|
+
### Wiring the seams by org size
|
|
230
|
+
|
|
231
|
+
The strong (`production`-mode) guarantees require a deployer to wire an
|
|
232
|
+
authorizer, an attestation verifier, and a witness. The
|
|
233
|
+
[`reference_adapters`](src/banking_agent_audit/reference_adapters.py) module
|
|
234
|
+
ships a minimum-viable-production path — a durable fsync'd file witness, an
|
|
235
|
+
HMAC-signed-token authorizer, and a single-external-attester verifier — so a
|
|
236
|
+
small bank or neobank is not stuck in advisory mode. An optional
|
|
237
|
+
`IndependenceDetector` seam adds a defense-in-depth cross-check on the
|
|
238
|
+
effective-challenge independence attestation. See [`docs/SIZING.md`](docs/SIZING.md)
|
|
239
|
+
for the per-size wiring table and retention floors.
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
## Testing and assurance
|
|
244
|
+
|
|
245
|
+
The platform is the proof. The suite is layered, and the hard cases come from
|
|
246
|
+
the real world:
|
|
247
|
+
|
|
248
|
+
- **Unit + contract** tests for every primitive, control, and obligation entry.
|
|
249
|
+
- **Property-based** tests (`hypothesis`) — thousands of generated cases across
|
|
250
|
+
ledger verify/tamper/regenerate invariants, level-gate monotonicity, DEFCON
|
|
251
|
+
transition algebra, and challenger≠primary.
|
|
252
|
+
- **Five AL-PROBES** in [`tests/adversarial/`](tests/adversarial/) — committed
|
|
253
|
+
reproductions of the constructions that defeat a defective primitive, each
|
|
254
|
+
asserting the corrected guarantee holds (one probe per primitive; AL-PROBE-02
|
|
255
|
+
is the assurance home for veto un-self-clearability).
|
|
256
|
+
- **A golden corpus** of real, public, primary-sourced banking enforcement
|
|
257
|
+
actions turned into fixtures that assert how the controls govern each
|
|
258
|
+
category. The platform is the proof: the suite runs against named CFPB / DOJ /
|
|
259
|
+
FinCEN matters of record — **Trustmark, City National, Trident Mortgage,
|
|
260
|
+
Washington Trust, Citibank, Fifth Third, Townstone, and TD Bank** — spanning
|
|
261
|
+
redlining, ECOA / Reg B adverse action, fair-lending model use, and BSA / AML /
|
|
262
|
+
OFAC failures. See [`tests/golden/`](tests/golden/).
|
|
263
|
+
- **A mutation pass** ([`scripts/mutation_pass.py`](scripts/mutation_pass.py))
|
|
264
|
+
that disables each security predicate and confirms a test kills it (100%).
|
|
265
|
+
- **Coverage gate** at 90% (currently ~99%), with `ruff`, `mypy --strict`,
|
|
266
|
+
Bandit, CodeQL, OSV, and gitleaks in CI.
|
|
267
|
+
|
|
268
|
+
```bash
|
|
269
|
+
pytest -q --cov=src/banking_agent_audit --cov-fail-under=90
|
|
270
|
+
python scripts/mutation_pass.py
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
---
|
|
274
|
+
|
|
275
|
+
## Who this is for
|
|
276
|
+
|
|
277
|
+
- **Heads of Model Risk and second-line validation** standing up effective
|
|
278
|
+
challenge for AI/agentic models where the validator's independence is the
|
|
279
|
+
load-bearing question.
|
|
280
|
+
- **Fair-lending and compliance teams** who need an adverse-action notice that
|
|
281
|
+
states specific, accurate reasons under ECOA/Reg B and the FCRA overlay.
|
|
282
|
+
- **AML / sanctions engineering** wiring a disposition workflow around a real
|
|
283
|
+
list provider, with a tamper-evident trail of every screen, hold, and block.
|
|
284
|
+
- **Board, audit committee, CISO, CRO, and the engineer who runs it** — each
|
|
285
|
+
reads a different layer; the claim layer is written so none of them is misled.
|
|
286
|
+
|
|
287
|
+
---
|
|
288
|
+
|
|
289
|
+
## Limitations
|
|
290
|
+
|
|
291
|
+
Read [`LIMITATIONS.md`](LIMITATIONS.md) and [`FAILURE-MODES.md`](FAILURE-MODES.md)
|
|
292
|
+
before relying on anything here. In short: this is reference IP, the sanctions
|
|
293
|
+
surface ships no list, the documented-pattern sub-verticals are not enforced in
|
|
294
|
+
code at 0.1.0, and reasoning-layer prompt-injection of the underlying model is
|
|
295
|
+
out of scope.
|
|
296
|
+
|
|
297
|
+
---
|
|
298
|
+
|
|
299
|
+
## Citation
|
|
300
|
+
|
|
301
|
+
Archived on Zenodo — concept DOI [`10.5281/zenodo.20564584`](https://doi.org/10.5281/zenodo.20564584)
|
|
302
|
+
(resolves to the latest version). See [`CITATION.cff`](CITATION.cff).
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
|
|
306
|
+
## License
|
|
307
|
+
|
|
308
|
+
Dual-licensed under [MIT](LICENSE-MIT) or [Apache-2.0](LICENSE-APACHE), at your
|
|
309
|
+
option.
|
|
310
|
+
|
|
311
|
+
---
|
|
312
|
+
|
|
313
|
+
## Author
|
|
314
|
+
|
|
315
|
+
Kunjar Bhaduri — North Texas Capital Investments.
|
|
316
|
+
|
|
317
|
+
---
|
|
318
|
+
|
|
319
|
+
## The Autonomy Ladder family
|
|
320
|
+
|
|
321
|
+
One of six libraries in the **[Autonomy Ladder family](https://github.com/linus10x/autonomy-ladder-libraries)** —
|
|
322
|
+
[finserv](https://github.com/linus10x/finserv-agent-audit) ·
|
|
323
|
+
[banking](https://github.com/linus10x/banking-agent-audit) ·
|
|
324
|
+
[payments](https://github.com/linus10x/payments-agent-audit) ·
|
|
325
|
+
[payer](https://github.com/linus10x/payer-agent-audit) ·
|
|
326
|
+
[private-capital](https://github.com/linus10x/private-capital-agent-audit) ·
|
|
327
|
+
[cre](https://github.com/linus10x/cre-agent-audit) agent-audit.
|
|
328
|
+
Shared framework (A0→A4, every rung demotable), license posture (MIT OR Apache-2.0),
|
|
329
|
+
and evidence discipline. Framework + whitepaper: [autonomy-ladder.io](https://autonomy-ladder.io).
|