outfence 0.1.0a2__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 (77) hide show
  1. outfence-0.1.0a2/CHANGELOG.md +52 -0
  2. outfence-0.1.0a2/CONTRIBUTING.md +40 -0
  3. outfence-0.1.0a2/LICENSE +202 -0
  4. outfence-0.1.0a2/MANIFEST.in +5 -0
  5. outfence-0.1.0a2/PKG-INFO +190 -0
  6. outfence-0.1.0a2/README.md +168 -0
  7. outfence-0.1.0a2/SECURITY.md +45 -0
  8. outfence-0.1.0a2/brand/README.md +94 -0
  9. outfence-0.1.0a2/brand/assets/avatar.png +0 -0
  10. outfence-0.1.0a2/brand/assets/avatar.svg +1 -0
  11. outfence-0.1.0a2/brand/assets/banner.png +0 -0
  12. outfence-0.1.0a2/brand/assets/banner.svg +1 -0
  13. outfence-0.1.0a2/brand/assets/brand-board.png +0 -0
  14. outfence-0.1.0a2/brand/assets/brand-board.svg +1 -0
  15. outfence-0.1.0a2/brand/assets/goose-alarm.png +0 -0
  16. outfence-0.1.0a2/brand/assets/goose-alarm.svg +1 -0
  17. outfence-0.1.0a2/brand/assets/goose-approving.png +0 -0
  18. outfence-0.1.0a2/brand/assets/goose-approving.svg +1 -0
  19. outfence-0.1.0a2/brand/assets/goose-blocking.png +0 -0
  20. outfence-0.1.0a2/brand/assets/goose-blocking.svg +1 -0
  21. outfence-0.1.0a2/brand/assets/goose-idle.png +0 -0
  22. outfence-0.1.0a2/brand/assets/goose-idle.svg +1 -0
  23. outfence-0.1.0a2/brand/assets/goose-watching.png +0 -0
  24. outfence-0.1.0a2/brand/assets/goose-watching.svg +1 -0
  25. outfence-0.1.0a2/brand/assets/mark-ink.png +0 -0
  26. outfence-0.1.0a2/brand/assets/mark-ink.svg +1 -0
  27. outfence-0.1.0a2/brand/assets/mark-white.png +0 -0
  28. outfence-0.1.0a2/brand/assets/mark-white.svg +1 -0
  29. outfence-0.1.0a2/brand/assets/social-preview.png +0 -0
  30. outfence-0.1.0a2/brand/assets/social-preview.svg +1 -0
  31. outfence-0.1.0a2/brand/assets/wordmark-dark.png +0 -0
  32. outfence-0.1.0a2/brand/assets/wordmark-dark.svg +1 -0
  33. outfence-0.1.0a2/brand/assets/wordmark-light.png +0 -0
  34. outfence-0.1.0a2/brand/assets/wordmark-light.svg +1 -0
  35. outfence-0.1.0a2/brand/mascot.json +11 -0
  36. outfence-0.1.0a2/brand/tokens.json +35 -0
  37. outfence-0.1.0a2/docs/ARCHITECTURE.md +39 -0
  38. outfence-0.1.0a2/docs/CLI.md +66 -0
  39. outfence-0.1.0a2/docs/OLLAMA-WALKTHROUGH.md +101 -0
  40. outfence-0.1.0a2/docs/PROVENANCE-WALKTHROUGH.md +106 -0
  41. outfence-0.1.0a2/docs/REPORT.md +52 -0
  42. outfence-0.1.0a2/examples/fetch_mcp_server.py +95 -0
  43. outfence-0.1.0a2/examples/mcp_agent.py +230 -0
  44. outfence-0.1.0a2/examples/ollama-policy-allow-readme.json +7 -0
  45. outfence-0.1.0a2/examples/ollama-policy.json +6 -0
  46. outfence-0.1.0a2/examples/ollama_agent.py +237 -0
  47. outfence-0.1.0a2/examples/policy.json +7 -0
  48. outfence-0.1.0a2/examples/provenance-policy.json +5 -0
  49. outfence-0.1.0a2/outfence/__init__.py +3 -0
  50. outfence-0.1.0a2/outfence/__main__.py +6 -0
  51. outfence-0.1.0a2/outfence/cli.py +253 -0
  52. outfence-0.1.0a2/outfence/console.py +309 -0
  53. outfence-0.1.0a2/outfence/core.py +7 -0
  54. outfence-0.1.0a2/outfence/demo.py +30 -0
  55. outfence-0.1.0a2/outfence/mascot.py +14 -0
  56. outfence-0.1.0a2/outfence/modeltap.py +97 -0
  57. outfence-0.1.0a2/outfence/policy.py +67 -0
  58. outfence-0.1.0a2/outfence/provenance.py +252 -0
  59. outfence-0.1.0a2/outfence/proxy.py +342 -0
  60. outfence-0.1.0a2/outfence/report.py +167 -0
  61. outfence-0.1.0a2/outfence.egg-info/PKG-INFO +190 -0
  62. outfence-0.1.0a2/outfence.egg-info/SOURCES.txt +75 -0
  63. outfence-0.1.0a2/outfence.egg-info/dependency_links.txt +1 -0
  64. outfence-0.1.0a2/outfence.egg-info/entry_points.txt +2 -0
  65. outfence-0.1.0a2/outfence.egg-info/top_level.txt +1 -0
  66. outfence-0.1.0a2/pyproject.toml +45 -0
  67. outfence-0.1.0a2/requirements-dev.txt +4 -0
  68. outfence-0.1.0a2/scripts/build_brand.py +157 -0
  69. outfence-0.1.0a2/scripts/smoke_install.py +47 -0
  70. outfence-0.1.0a2/scripts/terminal_svg.py +178 -0
  71. outfence-0.1.0a2/setup.cfg +4 -0
  72. outfence-0.1.0a2/tests/test_console.py +258 -0
  73. outfence-0.1.0a2/tests/test_mcp_agent.py +107 -0
  74. outfence-0.1.0a2/tests/test_ollama_agent.py +113 -0
  75. outfence-0.1.0a2/tests/test_provenance.py +305 -0
  76. outfence-0.1.0a2/tests/test_proxy.py +145 -0
  77. outfence-0.1.0a2/tests/test_release.py +241 -0
@@ -0,0 +1,52 @@
1
+ # Changelog
2
+
3
+ ## Unreleased
4
+
5
+ ## 0.1.0a2 - second alpha, first PyPI release
6
+
7
+ - Publish releases to PyPI from GitHub Actions with Trusted Publishing, so no API token is stored. The release workflow runs the tests, requires the tag to match the package version, and smoke-tests the wheel.
8
+ - Use absolute links and images in the README, so the PyPI project page renders it.
9
+ - Show a real terminal recording of `outfence demo` in the README. It is an animated SVG made by `scripts/terminal_svg.py`, which uses the standard library only and replaces local paths before rendering.
10
+ - Add an interactive terminal look, using the standard library only.
11
+ - The brand banner opens each run, and decisions print as they happen.
12
+ - The styled report ends with the goose pose for the outcome.
13
+ - `outfence` with no arguments shows a menu.
14
+ - Plain output for pipes, files and CI is unchanged. `NO_COLOR`, `OUTFENCE_COLOR`, `OUTFENCE_THEME` and `OUTFENCE_GOOSE` control the styling.
15
+ - Add a model tap for local OpenAI-compatible servers (`run --model-upstream`) and destination provenance.
16
+ - Each proxy decision records which source first named the host: the user, the system prompt, a tool definition, a tool result, or only the model.
17
+ - Each decision also records the inferred tool call and, when the offered tools changed, a trigger candidate.
18
+ - A new optional `allow_from` policy key permits hosts named by trusted sources. Model output never authorizes a destination.
19
+ - The tap fails closed on unreadable answers and keeps no prompt or answer text.
20
+ - Add a minimal stdio MCP fetch server and an MCP agent-loop example, with deterministic tests and a provenance walkthrough.
21
+
22
+ - Replace generated HTML with terminal reports showing decisions, counts, coverage, and separate workload outcomes. Keep JSON evidence and existing exit codes.
23
+ - Move planning drafts and obsolete schema examples into ignored local notes; retain practical user documentation.
24
+
25
+ - Add a live Ollama/Qwen repository-research agent, with explicit proxied HTTPS tools, blocked/allowed policies, deterministic tests, and a reproducible walkthrough.
26
+
27
+ - Replace the arrow-based identity with a minimal, monochrome split-ring symbol.
28
+ - Skip reverse DNS during loopback server startup, preventing cold-process demo timeouts on macOS CI.
29
+ - Add a regression check for DNS-free server startup and actionable smoke-test timeout output.
30
+
31
+ ## 0.1.0a1 - first alpha candidate
32
+
33
+ ### Added
34
+
35
+ - Installable Python package with the `outfence` console command and no runtime dependencies.
36
+ - `init`, `check`, `demo`, and `run` commands; JSON policy with exact host/port matching.
37
+ - Local synthetic demo, enforce/observe modes, HTTP GET forwarding and CONNECT tunnels.
38
+ - Offline HTML/JSON reports with policy snapshots, coverage limits, and workload outcomes.
39
+ - Apache-2.0 license, contributor guidance, security scope, CI and package smoke checks.
40
+
41
+ ### Corrected from the initial prototype
42
+
43
+ - Demo policy no longer depends on a source-checkout file after installation.
44
+ - Invalid and unsupported requests are represented in evidence.
45
+ - Upstream failures return an HTTP error and cannot produce a clean CLI outcome.
46
+ - Output directories are reserved before workload launch; reports cannot be overwritten.
47
+ - Active connections close at shutdown and incomplete evidence is disclosed.
48
+ - Policies reject ambiguous values, duplicate rules and boolean versions/ports.
49
+
50
+ ### Limits
51
+
52
+ Proxy-only coverage; no OS/container network isolation or tool attribution. macOS/Linux only. Initial source publication: github.com/gsaccardi/outfence. No package-registry release yet.
@@ -0,0 +1,40 @@
1
+ # Contributing to Outfence
2
+
3
+ Start with a small, reproducible problem. The current alpha is a proxy/report tool; container isolation is a separate investigation. Read the [README](README.md) and [security scope](SECURITY.md) before proposing stronger security claims.
4
+
5
+ ## Development
6
+
7
+ Python 3.10+ on macOS/Linux:
8
+
9
+ ```sh
10
+ python3 -m venv .venv
11
+ source .venv/bin/activate
12
+ python -m pip install -r requirements-dev.txt
13
+ python -m pip install --no-build-isolation -e .
14
+ ruff check outfence tests examples
15
+ ruff format --check outfence tests examples
16
+ python -m unittest discover -s tests -v
17
+ python -m build --no-isolation
18
+ ```
19
+
20
+ Use `ruff format outfence tests examples` to format changes. To check packaging, install the built wheel into a fresh virtual environment and run `scripts/smoke_install.py` with that environment's Python. It exercises the installed command from outside the checkout.
21
+
22
+ Tests must not require paid APIs or external services. Use local fixtures, explicit synthetic endpoint mappings, and destination-side assertions. Do not expand the public policy schema to allow the internal fixture bypass.
23
+
24
+ ## Pull requests
25
+
26
+ Explain the user-visible problem, the change, and how you verified it. Add regression coverage for behavior changes. Keep error and report strings free of request bodies, credentials, raw paths, and environment values. Update documentation when the supported behavior changes.
27
+
28
+ Report normal bugs with the issue template. Follow [SECURITY.md](SECURITY.md) for sensitive findings. Treat contributors respectfully, focus criticism on the work, and do not post personal or confidential information.
29
+
30
+ By submitting a contribution, you agree that it is provided under this repository's Apache-2.0 license. No additional CLA is required. Source files, tests, documentation, and generated artwork are included under that license; bundled third-party fonts are not distributed.
31
+
32
+ The Ollama walkthrough has deterministic CI tests. Live model tests are manual and require an installed local model; do not add credentials, model downloads, or public API calls to CI.
33
+
34
+ ## Releasing
35
+
36
+ Releases go to PyPI through Trusted Publishing: PyPI trusts the `Release` workflow's GitHub identity, so no API token exists anywhere.
37
+
38
+ 1. One-time setup: on PyPI, under Publishing, add a publisher for project `outfence` with owner `gsaccardi`, repository `outfence`, workflow `release.yml` and environment `pypi`. Before the first release this is a pending publisher.
39
+ 2. Bump `__version__` in `outfence/__init__.py`, move the `Unreleased` changelog entries under the new version, and merge.
40
+ 3. Publish a GitHub release whose tag is `v` plus the version, for example `v0.1.0a2`. The workflow runs the tests, refuses a tag that does not match the version, builds, smoke-tests the installed wheel and publishes.
@@ -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,5 @@
1
+ include LICENSE README.md CONTRIBUTING.md SECURITY.md CHANGELOG.md requirements-dev.txt
2
+ recursive-include examples *.json *.py
3
+ recursive-include docs *.md
4
+ recursive-include brand *.md *.json *.svg *.png
5
+ include scripts/smoke_install.py scripts/build_brand.py scripts/terminal_svg.py
@@ -0,0 +1,190 @@
1
+ Metadata-Version: 2.4
2
+ Name: outfence
3
+ Version: 0.1.0a2
4
+ Summary: Inspect proxy-routed agent connections with local policies and offline reports
5
+ Author: Outfence contributors
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Repository, https://github.com/gsaccardi/outfence
8
+ Project-URL: Issues, https://github.com/gsaccardi/outfence/issues
9
+ Project-URL: Changelog, https://github.com/gsaccardi/outfence/blob/main/CHANGELOG.md
10
+ Project-URL: Homepage, https://gsaccardi.github.io/outfence/
11
+ Keywords: ai-agents,proxy,network-policy,developer-tools
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Environment :: Console
14
+ Classifier: Operating System :: POSIX
15
+ Classifier: Operating System :: MacOS :: MacOS X
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Topic :: Software Development :: Testing
18
+ Requires-Python: >=3.10
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Dynamic: license-file
22
+
23
+ <p align="center"><img src="https://raw.githubusercontent.com/gsaccardi/outfence/main/brand/assets/banner.png" alt="Outfence - Know where your agents connect." width="100%"></p>
24
+
25
+ # Outfence
26
+
27
+ **Know where your agents connect.**
28
+
29
+ Outfence is a small, open source CLI that checks **proxy-routed outbound connections** against an allowlist and writes a terminal report and local JSON evidence. Use it to explore an agent's network dependencies and compare observation with blocking.
30
+
31
+ We're exploring how teams can **test AI agents against their deployment policies**, starting with outbound network dependencies. The question: before deploying or updating an agent, which external services does it need, and what happens when access is denied?
32
+
33
+ **Alpha 0.1.0a2, Apache-2.0, Python 3.10+, macOS/Linux, zero runtime dependencies**
34
+
35
+ > This is a local development proxy, **not a network sandbox**. Programs can ignore proxy settings and connect directly. Outfence does not prevent all data leaks, inspect encrypted content, or certify data residency. See [security and coverage](https://github.com/gsaccardi/outfence/blob/main/SECURITY.md).
36
+
37
+ ## Try it in one minute
38
+
39
+ Clone the repository and enter it:
40
+
41
+ ```sh
42
+ git clone https://github.com/gsaccardi/outfence.git
43
+ cd outfence
44
+ ```
45
+
46
+ Then run:
47
+
48
+ ```sh
49
+ python3 -m outfence demo
50
+ ```
51
+
52
+ No installation, Docker, API key, model, or internet connection is needed for this demo. It starts temporary localhost services and makes real HTTP requests through the proxy:
53
+
54
+ <p align="center"><img src="https://raw.githubusercontent.com/gsaccardi/outfence/main/docs/assets/terminal-demo.svg" alt="outfence demo in a terminal: model.example and retrieval.example are allowed, telemetry.example:80 is blocked, and the report ends with the goose blocking it" width="100%"></p>
55
+
56
+ The CLI prints connection decisions, counts, exit status, and coverage limits directly in your terminal. In an interactive terminal it prints each decision as it happens, and the report ends with the Capitoline goose in the pose that matches the outcome. Pipes, files and CI get the plain text report. The recording above is real `outfence demo` output, rendered with `scripts/terminal_svg.py`. It also saves `report.json` under `runs/`; no HTML is generated. **Exit 2 is expected:** the example deliberately attempts a blocked destination. Each invocation creates a new report directory and shuts down its local servers.
57
+
58
+ Compare observation mode:
59
+
60
+ ```sh
61
+ python3 -m outfence demo --mode observe
62
+ ```
63
+
64
+ All three fixture requests succeed; the last is recorded as `would_block`. Observation still exits 2 for a policy violation.
65
+
66
+ ## Install the command
67
+
68
+ From [PyPI](https://pypi.org/project/outfence/), with [pipx](https://pipx.pypa.io/):
69
+
70
+ ```sh
71
+ pipx install outfence
72
+ outfence --version
73
+ outfence demo
74
+ ```
75
+
76
+ `python3 -m pip install outfence` inside a virtual environment works too. The application has no third-party runtime dependencies, and the installed command works anywhere. To install from a checkout instead, run `python -m pip install .` from the repository root in a virtual environment.
77
+
78
+ ## Change a rule
79
+
80
+ ```sh
81
+ outfence init demo-policy.json --demo
82
+ outfence check demo-policy.json
83
+ outfence demo --policy demo-policy.json
84
+ ```
85
+
86
+ Add `{"host": "telemetry.example", "port": 80}` to the policy's `allow` array and rerun. All three demo requests should now succeed, with exit 0. Remove it to restore the blocked case.
87
+
88
+ A policy has an implicit default deny and exact hostname/port rules:
89
+
90
+ ```json
91
+ {
92
+ "version": 1,
93
+ "allow": [
94
+ {"host": "api.example.com", "port": 443}
95
+ ]
96
+ }
97
+ ```
98
+
99
+ `outfence init outfence.json` creates a **deny-all** policy. Hosts must be lowercase ASCII names (punycode for international names) or canonical IP addresses. Wildcards, trailing dots, duplicate rules, unknown fields, and invalid ports are rejected. Non-public upstream addresses remain blocked even if listed. Only the internal demo/test fixtures map synthetic names to localhost.
100
+
101
+ ## Run a proxy-aware program
102
+
103
+ ```sh
104
+ outfence run --policy outfence.json --timeout 60 -- python3 my_agent.py
105
+ ```
106
+
107
+ The runner sets `HTTP_PROXY`, `HTTPS_PROXY`, and lowercase equivalents, and clears `NO_PROXY`. The program must honor them. Your command runs with your normal permissions, credentials, and API costs; Outfence is not an execution sandbox.
108
+
109
+ | Supported in this alpha | Outside coverage |
110
+ |---|---|
111
+ | HTTP GET forwarding | HTTP POST/PUT/etc. forwarding, custom HTTP headers and authentication |
112
+ | CONNECT tunnels used by HTTPS clients | TLS/content inspection, confirmation that tunnel bytes are actually TLS |
113
+ | Exact destination rules and public-address checks | Direct sockets, clients that ignore proxy settings, remote service downstream connections |
114
+ | Local JSON policy snapshot and terminal decisions | Authenticated tool/process attribution and complete traffic inventory |
115
+ | Destination provenance from non-streaming chat completions to a local model server (`--model-upstream`) | Streaming responses, hosted model APIs, harnesses that mislabel message roles |
116
+ | Workload timeout and ordinary child process cleanup | Host isolation, detached-process containment, Windows support |
117
+
118
+ HTTPS uses the client's normal end-to-end TLS connection. Plain HTTP forwarding intentionally preserves only Host and Connection request headers and Content-Type/Location response headers; it is intended for simple diagnostics. CONNECT idle timeout is 15 seconds; socket operations time out after 10 seconds. See [CLI reference](https://github.com/gsaccardi/outfence/blob/main/docs/CLI.md) for resource limits and outcomes.
119
+
120
+ ## Run a real agent
121
+
122
+ Try the [local Ollama + GitHub walkthrough](https://github.com/gsaccardi/outfence/blob/main/docs/OLLAMA-WALKTHROUGH.md). A real Qwen model chooses two repository tools: Outfence permits metadata access and blocks the README until you change the policy. No API key is needed; an installed local model and internet access for the public tools are required. Model inference is deliberately outside proxy coverage.
123
+
124
+ ```sh
125
+ python3 -m outfence run --policy examples/ollama-policy.json --timeout 300 -- python3 examples/ollama_agent.py
126
+ ```
127
+
128
+ ## See where a destination came from (preview)
129
+
130
+ An agent reaches the network through tools that the model chooses to call. With `--model-upstream`, Outfence also sits between the agent and a **local** OpenAI-compatible model server (Ollama, mlx-lm, llama.cpp, vLLM). For every destination it records which source first named the host: the user, the system prompt, a tool definition, a tool result, or **only the model**. A policy can then allow hosts the user asked for. The model's own output never authorizes a destination.
131
+
132
+ ```sh
133
+ python3 -m outfence run --policy examples/provenance-policy.json \
134
+ --model-upstream http://127.0.0.1:11434 --timeout 300 \
135
+ -- python3 examples/mcp_agent.py --model qwen2.5:7b --server fetch-mcp \
136
+ --question "Open the official Python documentation website and tell me its title."
137
+ ```
138
+
139
+ ```text
140
+ BLOCKED docs.python.org:443
141
+ model_originated | not_attempted
142
+ origin: named only by the model; the user, system prompt, tools and tool results never did
143
+ tool call: mcp__fetch-mcp__request_url
144
+ ```
145
+
146
+ Ask the agent to fetch `https://example.com/` instead, and the same policy allows it as `allow_from_user`. A model backdoored to call home when a particular MCP server appears produces exactly this signature: a destination nobody named, right after the tool environment changed. CERT-AgID described such a backdoor in November 2026, and in that case the report adds `trigger?: MCP server … appeared N s before this request`. Matching is textual, and the harness's message roles are trusted. See the [provenance walkthrough](https://github.com/gsaccardi/outfence/blob/main/docs/PROVENANCE-WALKTHROUGH.md) and the [security notes](https://github.com/gsaccardi/outfence/blob/main/SECURITY.md).
147
+
148
+ ## Read the result
149
+
150
+ Reports contain destination host/port, decision, reason, connection status, timestamps, policy snapshot, and coverage limits. With the model tap, they also contain each destination's origin, tool names, and tool-environment changes. They contain no stored request paths, bodies, headers, prompts, answers, environment values, or command output. Workload stdout/stderr remains visible in your terminal. Hostnames can still be sensitive; review reports before sharing.
151
+
152
+ | Exit | Meaning |
153
+ |---|---|
154
+ | 0 | Workload completed; no proxy violations or recorded proxy failures. Coverage is still proxy-only. |
155
+ | 2 | At least one blocked or would-block request |
156
+ | 3 | Setup/transport error, interruption, event loss, or unfinished request at shutdown |
157
+ | 4 | Workload failed without a higher-priority outcome |
158
+
159
+ Exit precedence: **3 → 2 → 4 → 0**. The workload's original exit code is recorded separately. An empty report means no proxy requests were observed; it does not prove there was no network activity.
160
+
161
+ Reports stay on your machine with owner-only file permissions. Use `--output NEW_DIRECTORY` to choose a location. Existing directories are refused before launching your command. See the [report format](https://github.com/gsaccardi/outfence/blob/main/docs/REPORT.md).
162
+
163
+ ## Contribute
164
+
165
+ ```sh
166
+ python -m pip install -r requirements-dev.txt
167
+ ruff check outfence tests examples
168
+ ruff format --check outfence tests examples
169
+ python -m unittest discover -s tests -v
170
+ python -m build --no-isolation
171
+ ```
172
+
173
+ Tests use local fixtures and verify destination-side receipt. CI is configured for Python 3.10/3.13 on Linux and macOS, including installing the built wheel and running it outside the checkout. See [CONTRIBUTING.md](https://github.com/gsaccardi/outfence/blob/main/CONTRIBUTING.md).
174
+
175
+ Useful first contributions: sanitized agent-client compatibility cases, clearer report explanations, and feedback from people answering customer network-security questions.
176
+
177
+ ## Feedback and scope
178
+
179
+ We're investigating deployment checks for agents that teams build or adopt, starting with network dependencies. The Ollama walkthrough is the current verified real-agent example. Codex, Claude Code, and Copilot compatibility has not been verified.
180
+
181
+ What evidence would your team need before deploying an agent? [Open an issue](https://github.com/gsaccardi/outfence/issues) with a synthetic or sanitized workflow, the decision you need to make, and what your current tools cannot show.
182
+
183
+ - [CLI reference](https://github.com/gsaccardi/outfence/blob/main/docs/CLI.md)
184
+ - [JSON format](https://github.com/gsaccardi/outfence/blob/main/docs/REPORT.md)
185
+ - [Security](https://github.com/gsaccardi/outfence/blob/main/SECURITY.md)
186
+ - [Architecture](https://github.com/gsaccardi/outfence/blob/main/docs/ARCHITECTURE.md)
187
+ - [Changelog](https://github.com/gsaccardi/outfence/blob/main/CHANGELOG.md)
188
+ - [Brand kit](https://github.com/gsaccardi/outfence/blob/main/brand/README.md)
189
+
190
+ Licensed under [Apache-2.0](https://github.com/gsaccardi/outfence/blob/main/LICENSE). GitHub: [gsaccardi/outfence](https://github.com/gsaccardi/outfence). PyPI: [outfence](https://pypi.org/project/outfence/). No domain name has been registered yet.