agent-tessera-server 0.8.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.
Files changed (157) hide show
  1. agent_tessera_server-0.8.0/.gitignore +23 -0
  2. agent_tessera_server-0.8.0/Dockerfile +19 -0
  3. agent_tessera_server-0.8.0/LICENSE +202 -0
  4. agent_tessera_server-0.8.0/PKG-INFO +101 -0
  5. agent_tessera_server-0.8.0/README.md +64 -0
  6. agent_tessera_server-0.8.0/pyproject.toml +55 -0
  7. agent_tessera_server-0.8.0/src/tessera_server/__init__.py +5 -0
  8. agent_tessera_server-0.8.0/src/tessera_server/api/__init__.py +1 -0
  9. agent_tessera_server-0.8.0/src/tessera_server/api/alerts.py +119 -0
  10. agent_tessera_server-0.8.0/src/tessera_server/api/approvals.py +305 -0
  11. agent_tessera_server-0.8.0/src/tessera_server/api/console_parity.py +342 -0
  12. agent_tessera_server-0.8.0/src/tessera_server/api/custody.py +257 -0
  13. agent_tessera_server-0.8.0/src/tessera_server/api/dashboards.py +131 -0
  14. agent_tessera_server-0.8.0/src/tessera_server/api/deps.py +136 -0
  15. agent_tessera_server-0.8.0/src/tessera_server/api/effects.py +51 -0
  16. agent_tessera_server-0.8.0/src/tessera_server/api/errors.py +83 -0
  17. agent_tessera_server-0.8.0/src/tessera_server/api/event_reads.py +335 -0
  18. agent_tessera_server-0.8.0/src/tessera_server/api/events.py +206 -0
  19. agent_tessera_server-0.8.0/src/tessera_server/api/footprint.py +107 -0
  20. agent_tessera_server-0.8.0/src/tessera_server/api/jwks.py +35 -0
  21. agent_tessera_server-0.8.0/src/tessera_server/api/me.py +133 -0
  22. agent_tessera_server-0.8.0/src/tessera_server/api/oidc.py +190 -0
  23. agent_tessera_server-0.8.0/src/tessera_server/api/policies.py +296 -0
  24. agent_tessera_server-0.8.0/src/tessera_server/api/posture.py +48 -0
  25. agent_tessera_server-0.8.0/src/tessera_server/api/quotas.py +124 -0
  26. agent_tessera_server-0.8.0/src/tessera_server/api/registry.py +461 -0
  27. agent_tessera_server-0.8.0/src/tessera_server/api/runs.py +271 -0
  28. agent_tessera_server-0.8.0/src/tessera_server/api/search.py +50 -0
  29. agent_tessera_server-0.8.0/src/tessera_server/api/supervisors.py +98 -0
  30. agent_tessera_server-0.8.0/src/tessera_server/api/token.py +154 -0
  31. agent_tessera_server-0.8.0/src/tessera_server/api/webhooks.py +167 -0
  32. agent_tessera_server-0.8.0/src/tessera_server/app.py +193 -0
  33. agent_tessera_server-0.8.0/src/tessera_server/cli.py +266 -0
  34. agent_tessera_server-0.8.0/src/tessera_server/config.py +297 -0
  35. agent_tessera_server-0.8.0/src/tessera_server/db/__init__.py +6 -0
  36. agent_tessera_server-0.8.0/src/tessera_server/db/migrate.py +87 -0
  37. agent_tessera_server-0.8.0/src/tessera_server/db/migrations/__init__.py +1 -0
  38. agent_tessera_server-0.8.0/src/tessera_server/db/migrations/env.py +27 -0
  39. agent_tessera_server-0.8.0/src/tessera_server/db/migrations/script.py.mako +25 -0
  40. agent_tessera_server-0.8.0/src/tessera_server/db/migrations/versions/__init__.py +1 -0
  41. agent_tessera_server-0.8.0/src/tessera_server/db/migrations/versions/admin_sessions.py +51 -0
  42. agent_tessera_server-0.8.0/src/tessera_server/db/migrations/versions/alert_rules.py +55 -0
  43. agent_tessera_server-0.8.0/src/tessera_server/db/migrations/versions/approvals.py +54 -0
  44. agent_tessera_server-0.8.0/src/tessera_server/db/migrations/versions/event_index.py +122 -0
  45. agent_tessera_server-0.8.0/src/tessera_server/db/migrations/versions/initial.py +24 -0
  46. agent_tessera_server-0.8.0/src/tessera_server/db/migrations/versions/provider_secrets.py +44 -0
  47. agent_tessera_server-0.8.0/src/tessera_server/db/migrations/versions/quota_leases.py +56 -0
  48. agent_tessera_server-0.8.0/src/tessera_server/db/migrations/versions/run_effects.py +44 -0
  49. agent_tessera_server-0.8.0/src/tessera_server/db/migrations/versions/run_principal.py +38 -0
  50. agent_tessera_server-0.8.0/src/tessera_server/db/migrations/versions/run_supervisor.py +38 -0
  51. agent_tessera_server-0.8.0/src/tessera_server/db/migrations/versions/supervisor_ack.py +38 -0
  52. agent_tessera_server-0.8.0/src/tessera_server/db/migrations/versions/supervisor_grants.py +40 -0
  53. agent_tessera_server-0.8.0/src/tessera_server/db/migrations/versions/webhook_endpoints.py +43 -0
  54. agent_tessera_server-0.8.0/src/tessera_server/db/models.py +520 -0
  55. agent_tessera_server-0.8.0/src/tessera_server/db/session.py +85 -0
  56. agent_tessera_server-0.8.0/src/tessera_server/ids.py +36 -0
  57. agent_tessera_server-0.8.0/src/tessera_server/policy_templates/dev-permissive.yaml +17 -0
  58. agent_tessera_server-0.8.0/src/tessera_server/policy_templates/read-only.yaml +18 -0
  59. agent_tessera_server-0.8.0/src/tessera_server/policy_templates/support-with-approvals.yaml +32 -0
  60. agent_tessera_server-0.8.0/src/tessera_server/py.typed +0 -0
  61. agent_tessera_server-0.8.0/src/tessera_server/services/__init__.py +1 -0
  62. agent_tessera_server-0.8.0/src/tessera_server/services/alerts.py +349 -0
  63. agent_tessera_server-0.8.0/src/tessera_server/services/approvals.py +798 -0
  64. agent_tessera_server-0.8.0/src/tessera_server/services/audit.py +291 -0
  65. agent_tessera_server-0.8.0/src/tessera_server/services/custody.py +493 -0
  66. agent_tessera_server-0.8.0/src/tessera_server/services/dashboards.py +272 -0
  67. agent_tessera_server-0.8.0/src/tessera_server/services/delegation.py +161 -0
  68. agent_tessera_server-0.8.0/src/tessera_server/services/effects.py +104 -0
  69. agent_tessera_server-0.8.0/src/tessera_server/services/event_index.py +90 -0
  70. agent_tessera_server-0.8.0/src/tessera_server/services/event_query.py +464 -0
  71. agent_tessera_server-0.8.0/src/tessera_server/services/events.py +426 -0
  72. agent_tessera_server-0.8.0/src/tessera_server/services/footprint.py +272 -0
  73. agent_tessera_server-0.8.0/src/tessera_server/services/keys.py +294 -0
  74. agent_tessera_server-0.8.0/src/tessera_server/services/oidc.py +466 -0
  75. agent_tessera_server-0.8.0/src/tessera_server/services/overview.py +70 -0
  76. agent_tessera_server-0.8.0/src/tessera_server/services/policies.py +801 -0
  77. agent_tessera_server-0.8.0/src/tessera_server/services/policy_templates.py +97 -0
  78. agent_tessera_server-0.8.0/src/tessera_server/services/posture.py +367 -0
  79. agent_tessera_server-0.8.0/src/tessera_server/services/quotas.py +1005 -0
  80. agent_tessera_server-0.8.0/src/tessera_server/services/registry.py +1065 -0
  81. agent_tessera_server-0.8.0/src/tessera_server/services/revocations.py +485 -0
  82. agent_tessera_server-0.8.0/src/tessera_server/services/search.py +180 -0
  83. agent_tessera_server-0.8.0/src/tessera_server/services/secrets.py +265 -0
  84. agent_tessera_server-0.8.0/src/tessera_server/services/sessions.py +186 -0
  85. agent_tessera_server-0.8.0/src/tessera_server/services/supervision.py +392 -0
  86. agent_tessera_server-0.8.0/src/tessera_server/services/traces.py +206 -0
  87. agent_tessera_server-0.8.0/src/tessera_server/services/webhooks.py +718 -0
  88. agent_tessera_server-0.8.0/src/tessera_server/services/workload.py +150 -0
  89. agent_tessera_server-0.8.0/src/tessera_server/ui/__init__.py +5 -0
  90. agent_tessera_server-0.8.0/src/tessera_server/ui/auth.py +103 -0
  91. agent_tessera_server-0.8.0/src/tessera_server/ui/csrf.py +89 -0
  92. agent_tessera_server-0.8.0/src/tessera_server/ui/filters.py +84 -0
  93. agent_tessera_server-0.8.0/src/tessera_server/ui/router.py +289 -0
  94. agent_tessera_server-0.8.0/src/tessera_server/ui/static/VENDOR.md +6 -0
  95. agent_tessera_server-0.8.0/src/tessera_server/ui/static/fonts/IBMPlexMono-Medium.woff2 +0 -0
  96. agent_tessera_server-0.8.0/src/tessera_server/ui/static/fonts/IBMPlexMono-Regular.woff2 +0 -0
  97. agent_tessera_server-0.8.0/src/tessera_server/ui/static/fonts/Manrope-Variable.woff2 +0 -0
  98. agent_tessera_server-0.8.0/src/tessera_server/ui/static/style.css +1047 -0
  99. agent_tessera_server-0.8.0/src/tessera_server/ui/templates/login.html +26 -0
  100. agent_tessera_server-0.8.0/src/tessera_server/ui/time.py +100 -0
  101. agent_tessera_server-0.8.0/src/tessera_server/web/__init__.py +116 -0
  102. agent_tessera_server-0.8.0/src/tessera_server/web/dist/assets/AgentPolicy-BXH0m3Cu.js +1 -0
  103. agent_tessera_server-0.8.0/src/tessera_server/web/dist/assets/PolicyYamlEditor-DENQO_up.js +10 -0
  104. agent_tessera_server-0.8.0/src/tessera_server/web/dist/assets/index-CTWektdS.css +1 -0
  105. agent_tessera_server-0.8.0/src/tessera_server/web/dist/assets/index-DZ9G76mW.js +304 -0
  106. agent_tessera_server-0.8.0/src/tessera_server/web/dist/fonts/IBMPlexMono-Medium.woff2 +0 -0
  107. agent_tessera_server-0.8.0/src/tessera_server/web/dist/fonts/IBMPlexMono-Regular.woff2 +0 -0
  108. agent_tessera_server-0.8.0/src/tessera_server/web/dist/fonts/Manrope-Variable.woff2 +0 -0
  109. agent_tessera_server-0.8.0/src/tessera_server/web/dist/index.html +20 -0
  110. agent_tessera_server-0.8.0/tests/conftest.py +34 -0
  111. agent_tessera_server-0.8.0/tests/test_access_footprint.py +158 -0
  112. agent_tessera_server-0.8.0/tests/test_admin_cli.py +204 -0
  113. agent_tessera_server-0.8.0/tests/test_alerts.py +235 -0
  114. agent_tessera_server-0.8.0/tests/test_approvals.py +392 -0
  115. agent_tessera_server-0.8.0/tests/test_baseline_preview.py +129 -0
  116. agent_tessera_server-0.8.0/tests/test_console_parity.py +134 -0
  117. agent_tessera_server-0.8.0/tests/test_console_serve.py +82 -0
  118. agent_tessera_server-0.8.0/tests/test_csrf.py +70 -0
  119. agent_tessera_server-0.8.0/tests/test_custody.py +255 -0
  120. agent_tessera_server-0.8.0/tests/test_dashboards.py +212 -0
  121. agent_tessera_server-0.8.0/tests/test_delegation.py +219 -0
  122. agent_tessera_server-0.8.0/tests/test_dev.py +254 -0
  123. agent_tessera_server-0.8.0/tests/test_e2e_org.py +201 -0
  124. agent_tessera_server-0.8.0/tests/test_effects.py +231 -0
  125. agent_tessera_server-0.8.0/tests/test_event_histogram.py +156 -0
  126. agent_tessera_server-0.8.0/tests/test_event_index.py +287 -0
  127. agent_tessera_server-0.8.0/tests/test_event_query.py +318 -0
  128. agent_tessera_server-0.8.0/tests/test_event_stream.py +210 -0
  129. agent_tessera_server-0.8.0/tests/test_events.py +383 -0
  130. agent_tessera_server-0.8.0/tests/test_foundation.py +180 -0
  131. agent_tessera_server-0.8.0/tests/test_keys.py +165 -0
  132. agent_tessera_server-0.8.0/tests/test_live.py +175 -0
  133. agent_tessera_server-0.8.0/tests/test_oidc.py +282 -0
  134. agent_tessera_server-0.8.0/tests/test_openapi_me.py +109 -0
  135. agent_tessera_server-0.8.0/tests/test_package.py +6 -0
  136. agent_tessera_server-0.8.0/tests/test_policies.py +288 -0
  137. agent_tessera_server-0.8.0/tests/test_posture.py +228 -0
  138. agent_tessera_server-0.8.0/tests/test_quotas.py +510 -0
  139. agent_tessera_server-0.8.0/tests/test_quotas_snapshot.py +139 -0
  140. agent_tessera_server-0.8.0/tests/test_registry.py +406 -0
  141. agent_tessera_server-0.8.0/tests/test_relative_time.py +15 -0
  142. agent_tessera_server-0.8.0/tests/test_revocations_list.py +152 -0
  143. agent_tessera_server-0.8.0/tests/test_run_principal_env.py +164 -0
  144. agent_tessera_server-0.8.0/tests/test_run_trace.py +303 -0
  145. agent_tessera_server-0.8.0/tests/test_runs.py +236 -0
  146. agent_tessera_server-0.8.0/tests/test_search.py +147 -0
  147. agent_tessera_server-0.8.0/tests/test_sessions.py +213 -0
  148. agent_tessera_server-0.8.0/tests/test_supervision.py +329 -0
  149. agent_tessera_server-0.8.0/tests/test_token.py +279 -0
  150. agent_tessera_server-0.8.0/tests/test_ui.py +107 -0
  151. agent_tessera_server-0.8.0/tests/test_ui_filters.py +33 -0
  152. agent_tessera_server-0.8.0/tests/test_ui_search_reason.py +114 -0
  153. agent_tessera_server-0.8.0/tests/test_v1_cookie_auth.py +164 -0
  154. agent_tessera_server-0.8.0/tests/test_validation_errors.py +80 -0
  155. agent_tessera_server-0.8.0/tests/test_webhooks.py +349 -0
  156. agent_tessera_server-0.8.0/tests/test_workload.py +215 -0
  157. agent_tessera_server-0.8.0/tests/ui_helpers.py +43 -0
@@ -0,0 +1,23 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ .venv/
4
+ .env
5
+ *.egg-info/
6
+ /dist/
7
+ sdk/dist/
8
+ server/dist/
9
+ build/
10
+ .pytest_cache/
11
+ .mypy_cache/
12
+ .ruff_cache/
13
+ .coverage
14
+ htmlcov/
15
+ coverage.xml
16
+ site/
17
+ *.db
18
+ *.sqlite3
19
+ .tessera/
20
+ deploy/helm/agent-tessera/charts/*.tgz
21
+ web/node_modules/
22
+ server/src/tessera_server/web/dist/**
23
+ !server/src/tessera_server/web/dist/.gitkeep
@@ -0,0 +1,19 @@
1
+ FROM python:3.12-slim AS build
2
+
3
+ WORKDIR /src
4
+ RUN pip install --no-cache-dir uv
5
+ COPY . .
6
+ RUN uv build --all-packages -o /wheels
7
+
8
+ FROM python:3.12-slim
9
+
10
+ RUN useradd --create-home --uid 10001 tessera
11
+ WORKDIR /home/tessera
12
+ COPY --from=build /wheels /tmp/wheels
13
+ RUN pip install --no-cache-dir /tmp/wheels/agent_tessera-*.whl \
14
+ && pip install --no-cache-dir /tmp/wheels/agent_tessera_server-*.whl "psycopg[binary]" \
15
+ && rm -rf /tmp/wheels
16
+ USER tessera
17
+ EXPOSE 8700
18
+ ENTRYPOINT ["tessera", "server"]
19
+ CMD ["serve", "--host", "0.0.0.0", "--port", "8700"]
@@ -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,101 @@
1
+ Metadata-Version: 2.5
2
+ Name: agent-tessera-server
3
+ Version: 0.8.0
4
+ Summary: Control plane server for Agent Tessera.
5
+ Project-URL: Homepage, https://github.com/agent-tessera/agent-tessera
6
+ Project-URL: Documentation, https://github.com/agent-tessera/agent-tessera/tree/main/docs
7
+ Project-URL: Repository, https://github.com/agent-tessera/agent-tessera
8
+ Project-URL: Issues, https://github.com/agent-tessera/agent-tessera/issues
9
+ Project-URL: Changelog, https://github.com/agent-tessera/agent-tessera/blob/main/CHANGELOG.md
10
+ Author: Agent Tessera contributors
11
+ License-Expression: Apache-2.0
12
+ License-File: LICENSE
13
+ Keywords: ai-agents,audit,control-plane,governance,identity,policy
14
+ Classifier: Development Status :: 3 - Alpha
15
+ Classifier: Environment :: Web Environment
16
+ Classifier: Framework :: FastAPI
17
+ Classifier: Intended Audience :: Developers
18
+ Classifier: Intended Audience :: Information Technology
19
+ Classifier: Operating System :: OS Independent
20
+ Classifier: Programming Language :: Python :: 3
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Programming Language :: Python :: 3.13
24
+ Classifier: Topic :: Security
25
+ Classifier: Typing :: Typed
26
+ Requires-Python: >=3.11
27
+ Requires-Dist: agent-tessera==0.8.0
28
+ Requires-Dist: alembic>=1.13
29
+ Requires-Dist: fastapi>=0.115
30
+ Requires-Dist: jinja2>=3.1
31
+ Requires-Dist: python-multipart>=0.0.9
32
+ Requires-Dist: sqlalchemy<3,>=2.0.30
33
+ Requires-Dist: uvicorn>=0.30
34
+ Provides-Extra: postgres
35
+ Requires-Dist: psycopg[binary]>=3.2; extra == 'postgres'
36
+ Description-Content-Type: text/markdown
37
+
38
+ # agent-tessera-server
39
+
40
+ The control plane for [Agent Tessera](https://pypi.org/project/agent-tessera/).
41
+ It registers agents, issues short-lived signed credentials, signs and
42
+ distributes policy bundles, collects audit events, tracks guardrail posture,
43
+ and serves a web console at `/app`.
44
+
45
+ The SDK enforces policy inside each agent's process and works without this
46
+ server. Run the server when you want to manage a fleet of agents from one
47
+ place.
48
+
49
+ ```bash
50
+ pip install agent-tessera-server
51
+ ```
52
+
53
+ This also installs `agent-tessera` and adds `tessera server` commands. Python
54
+ 3.11 or newer.
55
+
56
+ ## Try it locally
57
+
58
+ ```bash
59
+ tessera server dev
60
+ ```
61
+
62
+ This creates a SQLite database in `.tessera/server.db`, listens on
63
+ `http://127.0.0.1:8700` (loopback only), and prints an admin key for the API
64
+ and the `tessera` command. Open `http://127.0.0.1:8700/app`; in dev mode the
65
+ console needs no sign-in from the same machine. Point an agent at the server
66
+ by setting `TESSERA_URL=http://127.0.0.1:8700`.
67
+
68
+ ## Run it for real
69
+
70
+ Set these environment variables:
71
+
72
+ - `TESSERA_SERVER_DATABASE_URL`: a SQLAlchemy URL for SQLite or Postgres.
73
+ For Postgres, install `agent-tessera-server[postgres]`.
74
+ - `TESSERA_SERVER_ISSUER`: the public base URL, with no trailing slash.
75
+ - `TESSERA_SERVER_KEK`: a base64-encoded 32-byte key that protects signing
76
+ keys at rest.
77
+ - `TESSERA_SERVER_ORG`: the organization slug. Defaults to `default`.
78
+
79
+ Then migrate, create an admin key, and serve:
80
+
81
+ ```bash
82
+ tessera server migrate
83
+ tessera server create-admin-key --name ops
84
+ tessera server serve --host 0.0.0.0 --port 8700
85
+ ```
86
+
87
+ `serve` refuses to start until the database is migrated. `tessera server
88
+ rotate-keys` rotates the policy signing key.
89
+
90
+ The repository also has a Docker Compose file (server plus Postgres) and a
91
+ Helm chart.
92
+
93
+ ## Links
94
+
95
+ - [Server guide](https://github.com/agent-tessera/agent-tessera/blob/main/docs/server.md):
96
+ registration, the kill switch, approvals, fail modes, and the console
97
+ - [Threat model](https://github.com/agent-tessera/agent-tessera/blob/main/docs/threat-model.md)
98
+ - [Source](https://github.com/agent-tessera/agent-tessera)
99
+ - [Changelog](https://github.com/agent-tessera/agent-tessera/blob/main/CHANGELOG.md)
100
+
101
+ Apache 2.0.
@@ -0,0 +1,64 @@
1
+ # agent-tessera-server
2
+
3
+ The control plane for [Agent Tessera](https://pypi.org/project/agent-tessera/).
4
+ It registers agents, issues short-lived signed credentials, signs and
5
+ distributes policy bundles, collects audit events, tracks guardrail posture,
6
+ and serves a web console at `/app`.
7
+
8
+ The SDK enforces policy inside each agent's process and works without this
9
+ server. Run the server when you want to manage a fleet of agents from one
10
+ place.
11
+
12
+ ```bash
13
+ pip install agent-tessera-server
14
+ ```
15
+
16
+ This also installs `agent-tessera` and adds `tessera server` commands. Python
17
+ 3.11 or newer.
18
+
19
+ ## Try it locally
20
+
21
+ ```bash
22
+ tessera server dev
23
+ ```
24
+
25
+ This creates a SQLite database in `.tessera/server.db`, listens on
26
+ `http://127.0.0.1:8700` (loopback only), and prints an admin key for the API
27
+ and the `tessera` command. Open `http://127.0.0.1:8700/app`; in dev mode the
28
+ console needs no sign-in from the same machine. Point an agent at the server
29
+ by setting `TESSERA_URL=http://127.0.0.1:8700`.
30
+
31
+ ## Run it for real
32
+
33
+ Set these environment variables:
34
+
35
+ - `TESSERA_SERVER_DATABASE_URL`: a SQLAlchemy URL for SQLite or Postgres.
36
+ For Postgres, install `agent-tessera-server[postgres]`.
37
+ - `TESSERA_SERVER_ISSUER`: the public base URL, with no trailing slash.
38
+ - `TESSERA_SERVER_KEK`: a base64-encoded 32-byte key that protects signing
39
+ keys at rest.
40
+ - `TESSERA_SERVER_ORG`: the organization slug. Defaults to `default`.
41
+
42
+ Then migrate, create an admin key, and serve:
43
+
44
+ ```bash
45
+ tessera server migrate
46
+ tessera server create-admin-key --name ops
47
+ tessera server serve --host 0.0.0.0 --port 8700
48
+ ```
49
+
50
+ `serve` refuses to start until the database is migrated. `tessera server
51
+ rotate-keys` rotates the policy signing key.
52
+
53
+ The repository also has a Docker Compose file (server plus Postgres) and a
54
+ Helm chart.
55
+
56
+ ## Links
57
+
58
+ - [Server guide](https://github.com/agent-tessera/agent-tessera/blob/main/docs/server.md):
59
+ registration, the kill switch, approvals, fail modes, and the console
60
+ - [Threat model](https://github.com/agent-tessera/agent-tessera/blob/main/docs/threat-model.md)
61
+ - [Source](https://github.com/agent-tessera/agent-tessera)
62
+ - [Changelog](https://github.com/agent-tessera/agent-tessera/blob/main/CHANGELOG.md)
63
+
64
+ Apache 2.0.
@@ -0,0 +1,55 @@
1
+ [project]
2
+ name = "agent-tessera-server"
3
+ dynamic = ["version"]
4
+ description = "Control plane server for Agent Tessera."
5
+ readme = "README.md"
6
+ requires-python = ">=3.11"
7
+ license = "Apache-2.0"
8
+ license-files = ["LICENSE"]
9
+ authors = [{ name = "Agent Tessera contributors" }]
10
+ keywords = ["ai-agents", "governance", "identity", "audit", "policy", "control-plane"]
11
+ classifiers = [
12
+ "Development Status :: 3 - Alpha",
13
+ "Environment :: Web Environment",
14
+ "Framework :: FastAPI",
15
+ "Intended Audience :: Developers",
16
+ "Intended Audience :: Information Technology",
17
+ "Operating System :: OS Independent",
18
+ "Programming Language :: Python :: 3",
19
+ "Programming Language :: Python :: 3.11",
20
+ "Programming Language :: Python :: 3.12",
21
+ "Programming Language :: Python :: 3.13",
22
+ "Topic :: Security",
23
+ "Typing :: Typed",
24
+ ]
25
+ dependencies = [
26
+ "agent-tessera==0.8.0",
27
+ "alembic>=1.13",
28
+ "fastapi>=0.115",
29
+ "jinja2>=3.1",
30
+ "python-multipart>=0.0.9",
31
+ "sqlalchemy>=2.0.30,<3",
32
+ "uvicorn>=0.30",
33
+ ]
34
+
35
+ [project.urls]
36
+ Homepage = "https://github.com/agent-tessera/agent-tessera"
37
+ Documentation = "https://github.com/agent-tessera/agent-tessera/tree/main/docs"
38
+ Repository = "https://github.com/agent-tessera/agent-tessera"
39
+ Issues = "https://github.com/agent-tessera/agent-tessera/issues"
40
+ Changelog = "https://github.com/agent-tessera/agent-tessera/blob/main/CHANGELOG.md"
41
+
42
+ [project.optional-dependencies]
43
+ postgres = [
44
+ "psycopg[binary]>=3.2",
45
+ ]
46
+
47
+ [build-system]
48
+ requires = ["hatchling"]
49
+ build-backend = "hatchling.build"
50
+
51
+ [tool.hatch.version]
52
+ path = "src/tessera_server/__init__.py"
53
+
54
+ [tool.hatch.build.targets.wheel]
55
+ packages = ["src/tessera_server"]
@@ -0,0 +1,5 @@
1
+ """Agent Tessera server: registry, credentials, policy distribution, and audit."""
2
+
3
+ __version__ = "0.8.0"
4
+
5
+ __all__ = ["__version__"]
@@ -0,0 +1 @@
1
+ """HTTP routers for the control plane."""
@@ -0,0 +1,119 @@
1
+ """Admin alert-rule routes."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Literal
6
+
7
+ from fastapi import APIRouter, Depends
8
+ from pydantic import BaseModel, ConfigDict, Field
9
+ from sqlalchemy.orm import Session
10
+
11
+ from tessera_server.api.deps import get_session, require_admin
12
+ from tessera_server.db.models import AdminKey
13
+ from tessera_server.services.alerts import create_alert, delete_alert, list_alerts
14
+
15
+ _ADMIN = Depends(require_admin)
16
+ _SESSION = Depends(get_session)
17
+ _Autonomy = Literal["assistive", "interactive", "supervised", "autonomous"]
18
+ _Metric = Literal["tokens_in", "tokens_out", "cost_usd", "model_calls", "tool_calls", "denials"]
19
+ _Action = Literal["webhook", "suspend"]
20
+
21
+
22
+ class _Selector(BaseModel):
23
+ """Labels and autonomy a rule applies to."""
24
+
25
+ model_config = ConfigDict(extra="forbid")
26
+
27
+ labels: dict[str, str] = Field(default_factory=dict)
28
+ autonomy: _Autonomy | None = None
29
+
30
+
31
+ class _CreateBody(BaseModel):
32
+ """Body of `POST /v1/alerts`."""
33
+
34
+ model_config = ConfigDict(extra="forbid")
35
+
36
+ name: str
37
+ metric: _Metric
38
+ threshold: float = Field(gt=0)
39
+ window: str
40
+ selector: _Selector = Field(default_factory=_Selector)
41
+ action: _Action
42
+
43
+
44
+ def alerts_router() -> APIRouter:
45
+ """Build the alert admin routes.
46
+
47
+ Returns:
48
+ A router for creating, listing, and deleting rules.
49
+
50
+ Example:
51
+ ```python
52
+ router = alerts_router()
53
+ assert router is not None
54
+ ```
55
+ """
56
+ router = APIRouter(tags=["alerts"])
57
+
58
+ @router.post("/v1/alerts")
59
+ def post_alert(
60
+ body: _CreateBody,
61
+ _admin: AdminKey | None = _ADMIN,
62
+ session: Session = _SESSION,
63
+ ) -> dict[str, object]:
64
+ """Store an alert rule.
65
+
66
+ Args:
67
+ body: Name, metric, threshold, window, selector, and action.
68
+ _admin: Authenticated admin key.
69
+ session: Database session.
70
+
71
+ Returns:
72
+ The stored rule.
73
+ """
74
+ return create_alert(
75
+ session,
76
+ name=body.name,
77
+ metric=body.metric,
78
+ threshold=body.threshold,
79
+ window=body.window,
80
+ labels=body.selector.labels,
81
+ autonomy=body.selector.autonomy,
82
+ action=body.action,
83
+ )
84
+
85
+ @router.get("/v1/alerts")
86
+ def read_alerts(
87
+ _admin: AdminKey | None = _ADMIN,
88
+ session: Session = _SESSION,
89
+ ) -> dict[str, object]:
90
+ """List alert rules.
91
+
92
+ Args:
93
+ _admin: Authenticated admin key.
94
+ session: Database session.
95
+
96
+ Returns:
97
+ Every stored rule, oldest first.
98
+ """
99
+ return list_alerts(session)
100
+
101
+ @router.delete("/v1/alerts/{alert_id}")
102
+ def remove_alert(
103
+ alert_id: str,
104
+ _admin: AdminKey | None = _ADMIN,
105
+ session: Session = _SESSION,
106
+ ) -> dict[str, str]:
107
+ """Delete an alert rule.
108
+
109
+ Args:
110
+ alert_id: Rule to delete.
111
+ _admin: Authenticated admin key.
112
+ session: Database session.
113
+
114
+ Returns:
115
+ The deleted id.
116
+ """
117
+ return delete_alert(session, alert_id)
118
+
119
+ return router