remit-lang 0.1.0__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.
- remit_lang-0.1.0/LICENSE +202 -0
- remit_lang-0.1.0/PKG-INFO +190 -0
- remit_lang-0.1.0/README.md +155 -0
- remit_lang-0.1.0/pyproject.toml +55 -0
- remit_lang-0.1.0/setup.cfg +4 -0
- remit_lang-0.1.0/src/remit/__init__.py +2 -0
- remit_lang-0.1.0/src/remit/__main__.py +5 -0
- remit_lang-0.1.0/src/remit/ask.py +83 -0
- remit_lang-0.1.0/src/remit/ast.py +264 -0
- remit_lang-0.1.0/src/remit/broker.py +411 -0
- remit_lang-0.1.0/src/remit/checker.py +1108 -0
- remit_lang-0.1.0/src/remit/cli.py +531 -0
- remit_lang-0.1.0/src/remit/data/AI_GUIDE.md +89 -0
- remit_lang-0.1.0/src/remit/data/LANGUAGE_SPEC.md +271 -0
- remit_lang-0.1.0/src/remit/data/examples/invoices/host.rmti +24 -0
- remit_lang-0.1.0/src/remit/data/examples/invoices/invoices.rmt +44 -0
- remit_lang-0.1.0/src/remit/data/examples/invoices/policy.toml +24 -0
- remit_lang-0.1.0/src/remit/data/examples/research/host.rmti +21 -0
- remit_lang-0.1.0/src/remit/data/examples/research/policy.toml +14 -0
- remit_lang-0.1.0/src/remit/data/examples/research/research.rmt +42 -0
- remit_lang-0.1.0/src/remit/data/examples/support/host.rmti +30 -0
- remit_lang-0.1.0/src/remit/data/examples/support/policy.toml +21 -0
- remit_lang-0.1.0/src/remit/data/examples/support/support.rmt +42 -0
- remit_lang-0.1.0/src/remit/errors.py +65 -0
- remit_lang-0.1.0/src/remit/formatter.py +259 -0
- remit_lang-0.1.0/src/remit/interpreter.py +484 -0
- remit_lang-0.1.0/src/remit/ir.py +82 -0
- remit_lang-0.1.0/src/remit/lexer.py +179 -0
- remit_lang-0.1.0/src/remit/mcp_server.py +305 -0
- remit_lang-0.1.0/src/remit/models.py +167 -0
- remit_lang-0.1.0/src/remit/parser.py +803 -0
- remit_lang-0.1.0/src/remit/patch.py +71 -0
- remit_lang-0.1.0/src/remit/project.py +154 -0
- remit_lang-0.1.0/src/remit/rterrors.py +72 -0
- remit_lang-0.1.0/src/remit/stdadapters.py +94 -0
- remit_lang-0.1.0/src/remit/types.py +178 -0
- remit_lang-0.1.0/src/remit/values.py +71 -0
- remit_lang-0.1.0/src/remit_lang.egg-info/PKG-INFO +190 -0
- remit_lang-0.1.0/src/remit_lang.egg-info/SOURCES.txt +47 -0
- remit_lang-0.1.0/src/remit_lang.egg-info/dependency_links.txt +1 -0
- remit_lang-0.1.0/src/remit_lang.egg-info/entry_points.txt +2 -0
- remit_lang-0.1.0/src/remit_lang.egg-info/requires.txt +9 -0
- remit_lang-0.1.0/src/remit_lang.egg-info/top_level.txt +1 -0
- remit_lang-0.1.0/tests/test_authority.py +35 -0
- remit_lang-0.1.0/tests/test_checker.py +205 -0
- remit_lang-0.1.0/tests/test_cli_regressions.py +50 -0
- remit_lang-0.1.0/tests/test_frontend.py +116 -0
- remit_lang-0.1.0/tests/test_mcp.py +105 -0
- remit_lang-0.1.0/tests/test_runtime.py +225 -0
remit_lang-0.1.0/LICENSE
ADDED
|
@@ -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,190 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: remit-lang
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A statically checked language for AI-agent workflows: know the capabilities, worst-case spend and data flows before the program runs.
|
|
5
|
+
Author: mrpacstar2-oss
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/mrpacstar2-oss/remit
|
|
8
|
+
Project-URL: Documentation, https://github.com/mrpacstar2-oss/remit/tree/main/docs
|
|
9
|
+
Project-URL: Source, https://github.com/mrpacstar2-oss/remit
|
|
10
|
+
Project-URL: Issues, https://github.com/mrpacstar2-oss/remit/issues
|
|
11
|
+
Keywords: ai-agents,agents,llm,mcp,model-context-protocol,static-analysis,guardrails,budget,spend-limits,prompt-injection,taint-tracking,human-in-the-loop,workflow,dsl
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
20
|
+
Classifier: Topic :: Security
|
|
21
|
+
Classifier: Topic :: Software Development :: Compilers
|
|
22
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
23
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
24
|
+
Requires-Python: >=3.11
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
License-File: LICENSE
|
|
27
|
+
Provides-Extra: dev
|
|
28
|
+
Requires-Dist: pytest; extra == "dev"
|
|
29
|
+
Requires-Dist: pydantic; extra == "dev"
|
|
30
|
+
Provides-Extra: mcp
|
|
31
|
+
Requires-Dist: mcp>=2.0; extra == "mcp"
|
|
32
|
+
Requires-Dist: uvicorn>=0.30; extra == "mcp"
|
|
33
|
+
Requires-Dist: starlette>=0.37; extra == "mcp"
|
|
34
|
+
Dynamic: license-file
|
|
35
|
+
|
|
36
|
+
# Remit
|
|
37
|
+
|
|
38
|
+
[](https://github.com/mrpacstar2-oss/remit/actions/workflows/ci.yml)
|
|
39
|
+
[](LICENSE)
|
|
40
|
+
[](#use-it-from-an-ai-client-mcp)
|
|
41
|
+
|
|
42
|
+
**Know what an AI-written program can do, and what it can cost, before it runs.**
|
|
43
|
+
|
|
44
|
+
<!-- mcp-name: io.github.mrpacstar2-oss/remit -->
|
|
45
|
+
|
|
46
|
+
An agent writes a workflow. You want to know three things before it touches a paid API, an inbox or a bank:
|
|
47
|
+
|
|
48
|
+
1. **Which tools can it reach?** Only the ones your host file lists.
|
|
49
|
+
2. **At most how many calls and how many dollars?** Proved statically, as a worst case, against *your* policy.
|
|
50
|
+
3. **Can untrusted text (a web page, an email, model output) reach a sensitive argument?** If so it is rejected, or
|
|
51
|
+
sent to a human for approval bound to the exact arguments.
|
|
52
|
+
|
|
53
|
+
Remit is a small statically checked language that makes those answers a compiler error instead of a hope. It is
|
|
54
|
+
written to be edited by AI agents; a runtime broker enforces the same rules and records a replayable trace.
|
|
55
|
+
|
|
56
|
+
```text
|
|
57
|
+
$ remit check spend_widened.rmt # the model "improved" it: 6 videos, bigger budget
|
|
58
|
+
error[E0502]: program may call 'gen.video' up to 6 time(s), but policy allows 3
|
|
59
|
+
error[E0503]: worst-case cost $3.0400 exceeds the policy budget $2.0000
|
|
60
|
+
|
|
61
|
+
$ remit check spend_skip_review.rmt # an edit that skips the review step
|
|
62
|
+
error[E0301]: data tagged unreviewed flows into 'gen.video' parameter 'asset_id', which denies it
|
|
63
|
+
note: 'img' is unreviewed because it derives from gen.image (line 6)
|
|
64
|
+
|
|
65
|
+
$ remit check spend.rmt # the safe version
|
|
66
|
+
program promo_assets: worst-case cost $1.5400 (budget $2.0000)
|
|
67
|
+
gen.image <= 1 call(s) <= $0.0400
|
|
68
|
+
gen.video <= 3 call(s) <= $1.5000
|
|
69
|
+
ok: spend.rmt (policy policy.toml)
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Animated version: [docs/demo/remit-demo.cast](docs/demo/remit-demo.cast) (`asciinema play docs/demo/remit-demo.cast`).
|
|
73
|
+
|
|
74
|
+
[Try Remit in the browser](https://remit.ascentterminal.com/try.html). The checker previews the workflow without executing it.
|
|
75
|
+
|
|
76
|
+
## Install and 30-second quick start
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
pipx install git+https://github.com/mrpacstar2-oss/remit # or: pip install git+https://github.com/mrpacstar2-oss/remit (Python 3.11+, no dependencies)
|
|
80
|
+
git clone https://github.com/mrpacstar2-oss/remit && cd remit/examples/media_spend
|
|
81
|
+
|
|
82
|
+
remit check spend.rmt # capabilities, worst-case calls and cost, data flows; compared with policy.toml
|
|
83
|
+
remit check spend_widened.rmt # blocked by the policy
|
|
84
|
+
remit test spend.rmt # test blocks on offline fixtures: nothing is paid
|
|
85
|
+
remit run spend.rmt -i subject=lighthouse -i brief=notes -i 'styles=["calm","storm"]' --fixtures fixtures/test_pass.json
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
A project is four files. Only the first is untrusted.
|
|
89
|
+
|
|
90
|
+
| File | Written by | Purpose |
|
|
91
|
+
|---|---|---|
|
|
92
|
+
| `*.rmt` | the AI agent (untrusted) | the workflow |
|
|
93
|
+
| `host.rmti` | you | the capabilities the program may call, their cost, idempotency, per-parameter `deny`/`approve` tags |
|
|
94
|
+
| `policy.toml` | you | the hard wall: grants, `max_calls`, allowed argument values, `max_usd` |
|
|
95
|
+
| `adapters.py` | you | live implementations (trusted code; holds the API keys) |
|
|
96
|
+
|
|
97
|
+
In CI, gate on `remit check program.rmt --policy policy.toml --require-policy`. A program's own `budget` is written
|
|
98
|
+
by the program author, so the policy is what counts.
|
|
99
|
+
|
|
100
|
+
Stopping for a human:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
remit run invoices.rmt # stops at a payment: "approval needed", with a digest
|
|
104
|
+
remit approve <digest> # approves that exact call (exact arguments, single use)
|
|
105
|
+
remit resume <run-id> # continues; completed calls are replayed, not repeated
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Use it from an AI client (MCP)
|
|
109
|
+
|
|
110
|
+
The MCP server gives an agent the guide, a checker, a formatter and an authority diff, so it can write a program,
|
|
111
|
+
see the errors and fix them itself. Tools: `remit_guide`, `remit_check`, `remit_format`, `remit_authority_diff`,
|
|
112
|
+
`remit_examples`, `remit_run_fixtures`.
|
|
113
|
+
|
|
114
|
+
**Claude Code**
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
claude mcp add remit -- uvx --from "remit-lang[mcp]" remit mcp
|
|
118
|
+
# or, hosted (no install):
|
|
119
|
+
claude mcp add --transport http remit https://remit.ascentterminal.com/mcp
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
**Claude Desktop** (`claude_desktop_config.json`)
|
|
123
|
+
|
|
124
|
+
```json
|
|
125
|
+
{ "mcpServers": { "remit": { "command": "uvx", "args": ["--from", "remit-lang[mcp]", "remit", "mcp"] } } }
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
**Cursor** (`.cursor/mcp.json`, or Settings, MCP)
|
|
129
|
+
|
|
130
|
+
```json
|
|
131
|
+
{ "mcpServers": { "remit": { "command": "uvx", "args": ["--from", "remit-lang[mcp]", "remit", "mcp"] } } }
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Already installed with `pipx install "remit-lang[mcp]"`? Use `"command": "remit", "args": ["mcp"]`. Hosted HTTP
|
|
135
|
+
server for any client that supports it: `https://remit.ascentterminal.com/mcp`.
|
|
136
|
+
|
|
137
|
+
## Why not just ...?
|
|
138
|
+
|
|
139
|
+
Honest comparison. Remit is not a replacement for any of these; it covers a gap between them.
|
|
140
|
+
|
|
141
|
+
| Instead of | What that gives you | What Remit adds, and where it loses |
|
|
142
|
+
|---|---|---|
|
|
143
|
+
| **Plain Python with checks in each tool wrapper** | Total flexibility, no new language. Runtime guards work fine. | Remit proves the worst case *before* the run, covers every path (not just the ones you tested) and shows a diff of authority when an agent edits the program. It loses on flexibility and familiarity: it is a new, deliberately small language. |
|
|
144
|
+
| **An agent framework (LangGraph, CrewAI, ...)** | Orchestration, memory, integrations. | Frameworks run whatever the graph says; Remit does not orchestrate, it constrains. They can be combined: put the tool layer behind Remit's broker. |
|
|
145
|
+
| **A sandbox or container** | Real isolation of the process, files and network. | Remit has **no sandbox**. It answers a different question (what spend, what flows) and should run inside one. |
|
|
146
|
+
| **Provider spend caps and rate limits** | A hard stop at the provider, always on. | Keep them. Remit tells you *before the run* that a plan can reach the cap, per workflow, and stops it at the call that would cross the limit. |
|
|
147
|
+
| **LLM guardrails / prompt-injection filters** | A probabilistic check on text. | Remit is deterministic: a value tagged untrusted cannot reach a denied parameter. It does not read or judge text, so it cannot catch a bad but allowed argument. |
|
|
148
|
+
| **MCP gateways and proxies** | Per-tool allow lists and rate limits at runtime. | Remit adds the static, whole-program view (worst-case totals, data flow) and approvals bound to exact arguments. Gateways win on drop-in use with existing agents. |
|
|
149
|
+
|
|
150
|
+
Limits to know: costs are what the host declares (an overrun is recorded after the fact, and the broker refuses the
|
|
151
|
+
next call that would cross the limit); traces are clear text; no modules or concurrency yet.
|
|
152
|
+
|
|
153
|
+
## For AI agents
|
|
154
|
+
|
|
155
|
+
- **Quick guide:** [docs/AI_GUIDE.md](docs/AI_GUIDE.md). **Full specification:** [docs/LANGUAGE_SPEC.md](docs/LANGUAGE_SPEC.md).
|
|
156
|
+
- **`llms.txt`:** [site/llms.txt](site/llms.txt), plus [site/llms-full.txt](site/llms-full.txt).
|
|
157
|
+
- Example applications (support triage, research, invoices, coding loop, claim verification, paid media generation):
|
|
158
|
+
[examples/](examples/README.md).
|
|
159
|
+
|
|
160
|
+
## Documentation
|
|
161
|
+
|
|
162
|
+
[docs/README.md](docs/README.md) is the index. Contributing: [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
163
|
+
|
|
164
|
+
## Evidence
|
|
165
|
+
|
|
166
|
+
[docs/BENCHMARKS.md](docs/BENCHMARKS.md) compares Remit with a Python baseline that uses **the same runtime**, so
|
|
167
|
+
runtime features are not credited to the language. Samples are small, use one model family and include no human
|
|
168
|
+
trials.
|
|
169
|
+
|
|
170
|
+
- **Safety:**
|
|
171
|
+
- Of 17 unsafe program mutations, 14 were rejected before running. Python on the same runtime executed 8 of them.
|
|
172
|
+
- Asked to make unsafe changes, Haiku 4.5 agents shipped executable unsafe code 0/6 times in Remit and 6/6 in
|
|
173
|
+
Python. Sonnet 5.5 refused in both languages.
|
|
174
|
+
- **Review:** every agent-written feature change (20 of 20) was mechanically shown not to widen authority.
|
|
175
|
+
- **Ease:**
|
|
176
|
+
- Agents modified programs (15/15 against 14/15) and built a new workflow from a spec (5/5 against 5/5) **equally
|
|
177
|
+
well** in both languages, so there is no penalty for a language the models had never seen.
|
|
178
|
+
- Agents that only had the MCP server built correct programs 5/5.
|
|
179
|
+
- **Recovery:** crash-and-resume behaviour is identical in both, as expected, since it is a runtime property.
|
|
180
|
+
|
|
181
|
+
## Status
|
|
182
|
+
|
|
183
|
+
Remit is an early, open-source release. The language, checker, runtime, MCP server, demo and five example apps
|
|
184
|
+
all work and are tested. It is not yet a finished product: there is no built-in sandboxing (run it inside your own
|
|
185
|
+
isolated environment) and no module system, concurrency or editor language server yet. See
|
|
186
|
+
[LANGUAGE_SPEC §13](docs/LANGUAGE_SPEC.md#13-proposals-not-implemented) for what is planned.
|
|
187
|
+
|
|
188
|
+
Running your own copy of the website and MCP server is covered in [deploy/README.md](deploy/README.md).
|
|
189
|
+
|
|
190
|
+
Licence: Apache-2.0.
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
# Remit
|
|
2
|
+
|
|
3
|
+
[](https://github.com/mrpacstar2-oss/remit/actions/workflows/ci.yml)
|
|
4
|
+
[](LICENSE)
|
|
5
|
+
[](#use-it-from-an-ai-client-mcp)
|
|
6
|
+
|
|
7
|
+
**Know what an AI-written program can do, and what it can cost, before it runs.**
|
|
8
|
+
|
|
9
|
+
<!-- mcp-name: io.github.mrpacstar2-oss/remit -->
|
|
10
|
+
|
|
11
|
+
An agent writes a workflow. You want to know three things before it touches a paid API, an inbox or a bank:
|
|
12
|
+
|
|
13
|
+
1. **Which tools can it reach?** Only the ones your host file lists.
|
|
14
|
+
2. **At most how many calls and how many dollars?** Proved statically, as a worst case, against *your* policy.
|
|
15
|
+
3. **Can untrusted text (a web page, an email, model output) reach a sensitive argument?** If so it is rejected, or
|
|
16
|
+
sent to a human for approval bound to the exact arguments.
|
|
17
|
+
|
|
18
|
+
Remit is a small statically checked language that makes those answers a compiler error instead of a hope. It is
|
|
19
|
+
written to be edited by AI agents; a runtime broker enforces the same rules and records a replayable trace.
|
|
20
|
+
|
|
21
|
+
```text
|
|
22
|
+
$ remit check spend_widened.rmt # the model "improved" it: 6 videos, bigger budget
|
|
23
|
+
error[E0502]: program may call 'gen.video' up to 6 time(s), but policy allows 3
|
|
24
|
+
error[E0503]: worst-case cost $3.0400 exceeds the policy budget $2.0000
|
|
25
|
+
|
|
26
|
+
$ remit check spend_skip_review.rmt # an edit that skips the review step
|
|
27
|
+
error[E0301]: data tagged unreviewed flows into 'gen.video' parameter 'asset_id', which denies it
|
|
28
|
+
note: 'img' is unreviewed because it derives from gen.image (line 6)
|
|
29
|
+
|
|
30
|
+
$ remit check spend.rmt # the safe version
|
|
31
|
+
program promo_assets: worst-case cost $1.5400 (budget $2.0000)
|
|
32
|
+
gen.image <= 1 call(s) <= $0.0400
|
|
33
|
+
gen.video <= 3 call(s) <= $1.5000
|
|
34
|
+
ok: spend.rmt (policy policy.toml)
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Animated version: [docs/demo/remit-demo.cast](docs/demo/remit-demo.cast) (`asciinema play docs/demo/remit-demo.cast`).
|
|
38
|
+
|
|
39
|
+
[Try Remit in the browser](https://remit.ascentterminal.com/try.html). The checker previews the workflow without executing it.
|
|
40
|
+
|
|
41
|
+
## Install and 30-second quick start
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
pipx install git+https://github.com/mrpacstar2-oss/remit # or: pip install git+https://github.com/mrpacstar2-oss/remit (Python 3.11+, no dependencies)
|
|
45
|
+
git clone https://github.com/mrpacstar2-oss/remit && cd remit/examples/media_spend
|
|
46
|
+
|
|
47
|
+
remit check spend.rmt # capabilities, worst-case calls and cost, data flows; compared with policy.toml
|
|
48
|
+
remit check spend_widened.rmt # blocked by the policy
|
|
49
|
+
remit test spend.rmt # test blocks on offline fixtures: nothing is paid
|
|
50
|
+
remit run spend.rmt -i subject=lighthouse -i brief=notes -i 'styles=["calm","storm"]' --fixtures fixtures/test_pass.json
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
A project is four files. Only the first is untrusted.
|
|
54
|
+
|
|
55
|
+
| File | Written by | Purpose |
|
|
56
|
+
|---|---|---|
|
|
57
|
+
| `*.rmt` | the AI agent (untrusted) | the workflow |
|
|
58
|
+
| `host.rmti` | you | the capabilities the program may call, their cost, idempotency, per-parameter `deny`/`approve` tags |
|
|
59
|
+
| `policy.toml` | you | the hard wall: grants, `max_calls`, allowed argument values, `max_usd` |
|
|
60
|
+
| `adapters.py` | you | live implementations (trusted code; holds the API keys) |
|
|
61
|
+
|
|
62
|
+
In CI, gate on `remit check program.rmt --policy policy.toml --require-policy`. A program's own `budget` is written
|
|
63
|
+
by the program author, so the policy is what counts.
|
|
64
|
+
|
|
65
|
+
Stopping for a human:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
remit run invoices.rmt # stops at a payment: "approval needed", with a digest
|
|
69
|
+
remit approve <digest> # approves that exact call (exact arguments, single use)
|
|
70
|
+
remit resume <run-id> # continues; completed calls are replayed, not repeated
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Use it from an AI client (MCP)
|
|
74
|
+
|
|
75
|
+
The MCP server gives an agent the guide, a checker, a formatter and an authority diff, so it can write a program,
|
|
76
|
+
see the errors and fix them itself. Tools: `remit_guide`, `remit_check`, `remit_format`, `remit_authority_diff`,
|
|
77
|
+
`remit_examples`, `remit_run_fixtures`.
|
|
78
|
+
|
|
79
|
+
**Claude Code**
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
claude mcp add remit -- uvx --from "remit-lang[mcp]" remit mcp
|
|
83
|
+
# or, hosted (no install):
|
|
84
|
+
claude mcp add --transport http remit https://remit.ascentterminal.com/mcp
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**Claude Desktop** (`claude_desktop_config.json`)
|
|
88
|
+
|
|
89
|
+
```json
|
|
90
|
+
{ "mcpServers": { "remit": { "command": "uvx", "args": ["--from", "remit-lang[mcp]", "remit", "mcp"] } } }
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**Cursor** (`.cursor/mcp.json`, or Settings, MCP)
|
|
94
|
+
|
|
95
|
+
```json
|
|
96
|
+
{ "mcpServers": { "remit": { "command": "uvx", "args": ["--from", "remit-lang[mcp]", "remit", "mcp"] } } }
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Already installed with `pipx install "remit-lang[mcp]"`? Use `"command": "remit", "args": ["mcp"]`. Hosted HTTP
|
|
100
|
+
server for any client that supports it: `https://remit.ascentterminal.com/mcp`.
|
|
101
|
+
|
|
102
|
+
## Why not just ...?
|
|
103
|
+
|
|
104
|
+
Honest comparison. Remit is not a replacement for any of these; it covers a gap between them.
|
|
105
|
+
|
|
106
|
+
| Instead of | What that gives you | What Remit adds, and where it loses |
|
|
107
|
+
|---|---|---|
|
|
108
|
+
| **Plain Python with checks in each tool wrapper** | Total flexibility, no new language. Runtime guards work fine. | Remit proves the worst case *before* the run, covers every path (not just the ones you tested) and shows a diff of authority when an agent edits the program. It loses on flexibility and familiarity: it is a new, deliberately small language. |
|
|
109
|
+
| **An agent framework (LangGraph, CrewAI, ...)** | Orchestration, memory, integrations. | Frameworks run whatever the graph says; Remit does not orchestrate, it constrains. They can be combined: put the tool layer behind Remit's broker. |
|
|
110
|
+
| **A sandbox or container** | Real isolation of the process, files and network. | Remit has **no sandbox**. It answers a different question (what spend, what flows) and should run inside one. |
|
|
111
|
+
| **Provider spend caps and rate limits** | A hard stop at the provider, always on. | Keep them. Remit tells you *before the run* that a plan can reach the cap, per workflow, and stops it at the call that would cross the limit. |
|
|
112
|
+
| **LLM guardrails / prompt-injection filters** | A probabilistic check on text. | Remit is deterministic: a value tagged untrusted cannot reach a denied parameter. It does not read or judge text, so it cannot catch a bad but allowed argument. |
|
|
113
|
+
| **MCP gateways and proxies** | Per-tool allow lists and rate limits at runtime. | Remit adds the static, whole-program view (worst-case totals, data flow) and approvals bound to exact arguments. Gateways win on drop-in use with existing agents. |
|
|
114
|
+
|
|
115
|
+
Limits to know: costs are what the host declares (an overrun is recorded after the fact, and the broker refuses the
|
|
116
|
+
next call that would cross the limit); traces are clear text; no modules or concurrency yet.
|
|
117
|
+
|
|
118
|
+
## For AI agents
|
|
119
|
+
|
|
120
|
+
- **Quick guide:** [docs/AI_GUIDE.md](docs/AI_GUIDE.md). **Full specification:** [docs/LANGUAGE_SPEC.md](docs/LANGUAGE_SPEC.md).
|
|
121
|
+
- **`llms.txt`:** [site/llms.txt](site/llms.txt), plus [site/llms-full.txt](site/llms-full.txt).
|
|
122
|
+
- Example applications (support triage, research, invoices, coding loop, claim verification, paid media generation):
|
|
123
|
+
[examples/](examples/README.md).
|
|
124
|
+
|
|
125
|
+
## Documentation
|
|
126
|
+
|
|
127
|
+
[docs/README.md](docs/README.md) is the index. Contributing: [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
128
|
+
|
|
129
|
+
## Evidence
|
|
130
|
+
|
|
131
|
+
[docs/BENCHMARKS.md](docs/BENCHMARKS.md) compares Remit with a Python baseline that uses **the same runtime**, so
|
|
132
|
+
runtime features are not credited to the language. Samples are small, use one model family and include no human
|
|
133
|
+
trials.
|
|
134
|
+
|
|
135
|
+
- **Safety:**
|
|
136
|
+
- Of 17 unsafe program mutations, 14 were rejected before running. Python on the same runtime executed 8 of them.
|
|
137
|
+
- Asked to make unsafe changes, Haiku 4.5 agents shipped executable unsafe code 0/6 times in Remit and 6/6 in
|
|
138
|
+
Python. Sonnet 5.5 refused in both languages.
|
|
139
|
+
- **Review:** every agent-written feature change (20 of 20) was mechanically shown not to widen authority.
|
|
140
|
+
- **Ease:**
|
|
141
|
+
- Agents modified programs (15/15 against 14/15) and built a new workflow from a spec (5/5 against 5/5) **equally
|
|
142
|
+
well** in both languages, so there is no penalty for a language the models had never seen.
|
|
143
|
+
- Agents that only had the MCP server built correct programs 5/5.
|
|
144
|
+
- **Recovery:** crash-and-resume behaviour is identical in both, as expected, since it is a runtime property.
|
|
145
|
+
|
|
146
|
+
## Status
|
|
147
|
+
|
|
148
|
+
Remit is an early, open-source release. The language, checker, runtime, MCP server, demo and five example apps
|
|
149
|
+
all work and are tested. It is not yet a finished product: there is no built-in sandboxing (run it inside your own
|
|
150
|
+
isolated environment) and no module system, concurrency or editor language server yet. See
|
|
151
|
+
[LANGUAGE_SPEC §13](docs/LANGUAGE_SPEC.md#13-proposals-not-implemented) for what is planned.
|
|
152
|
+
|
|
153
|
+
Running your own copy of the website and MCP server is covered in [deploy/README.md](deploy/README.md).
|
|
154
|
+
|
|
155
|
+
Licence: Apache-2.0.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "remit-lang"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "A statically checked language for AI-agent workflows: know the capabilities, worst-case spend and data flows before the program runs."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.11"
|
|
11
|
+
license = "Apache-2.0"
|
|
12
|
+
license-files = ["LICENSE"]
|
|
13
|
+
authors = [{ name = "mrpacstar2-oss" }]
|
|
14
|
+
keywords = [
|
|
15
|
+
"ai-agents", "agents", "llm", "mcp", "model-context-protocol", "static-analysis",
|
|
16
|
+
"guardrails", "budget", "spend-limits", "prompt-injection", "taint-tracking",
|
|
17
|
+
"human-in-the-loop", "workflow", "dsl",
|
|
18
|
+
]
|
|
19
|
+
classifiers = [
|
|
20
|
+
"Development Status :: 3 - Alpha",
|
|
21
|
+
"Intended Audience :: Developers",
|
|
22
|
+
"Operating System :: OS Independent",
|
|
23
|
+
"Programming Language :: Python :: 3",
|
|
24
|
+
"Programming Language :: Python :: 3.11",
|
|
25
|
+
"Programming Language :: Python :: 3.12",
|
|
26
|
+
"Programming Language :: Python :: 3.13",
|
|
27
|
+
"Programming Language :: Python :: 3.14",
|
|
28
|
+
"Topic :: Security",
|
|
29
|
+
"Topic :: Software Development :: Compilers",
|
|
30
|
+
"Topic :: Software Development :: Quality Assurance",
|
|
31
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
32
|
+
]
|
|
33
|
+
dependencies = []
|
|
34
|
+
|
|
35
|
+
[project.urls]
|
|
36
|
+
Homepage = "https://github.com/mrpacstar2-oss/remit"
|
|
37
|
+
Documentation = "https://github.com/mrpacstar2-oss/remit/tree/main/docs"
|
|
38
|
+
Source = "https://github.com/mrpacstar2-oss/remit"
|
|
39
|
+
Issues = "https://github.com/mrpacstar2-oss/remit/issues"
|
|
40
|
+
|
|
41
|
+
[project.scripts]
|
|
42
|
+
remit = "remit.cli:main"
|
|
43
|
+
|
|
44
|
+
[project.optional-dependencies]
|
|
45
|
+
dev = ["pytest", "pydantic"]
|
|
46
|
+
mcp = ["mcp>=2.0", "uvicorn>=0.30", "starlette>=0.37"]
|
|
47
|
+
|
|
48
|
+
[tool.setuptools.packages.find]
|
|
49
|
+
where = ["src"]
|
|
50
|
+
|
|
51
|
+
[tool.setuptools.package-data]
|
|
52
|
+
remit = ["data/*.md", "data/examples/*/*"]
|
|
53
|
+
|
|
54
|
+
[tool.pytest.ini_options]
|
|
55
|
+
testpaths = ["tests"]
|