startup-trust-guard 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.
@@ -0,0 +1,24 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 hao li
4
+
5
+ Bundled CPython tomllib modules (_toml_*.py):
6
+ Copyright (c) 2021 Taneli Hukkinen (MIT; licensed to PSF under a Contributor Agreement)
7
+
8
+ Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ of this software and associated documentation files (the "Software"), to deal
10
+ in the Software without restriction, including without limitation the rights
11
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ copies of the Software, and to permit persons to whom the Software is
13
+ furnished to do so, subject to the following conditions:
14
+
15
+ The above copyright notice and this permission notice shall be included in all
16
+ copies or substantial portions of the Software.
17
+
18
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
+ SOFTWARE.
@@ -0,0 +1,77 @@
1
+ Metadata-Version: 2.4
2
+ Name: startup-trust-guard
3
+ Version: 0.1.0
4
+ Summary: Inspect agent startup instructions and configuration trust
5
+ Author: hao li
6
+ License: MIT
7
+ Requires-Python: >=3.9
8
+ Description-Content-Type: text/markdown
9
+ License-File: LICENSE
10
+ Dynamic: license-file
11
+
12
+ # startup-trust-guard
13
+
14
+ A website can download AGENTS.md or CLAUDE.md into Downloads, where an agent
15
+ may later treat it as trusted instructions. Agent configuration can also be
16
+ changed to add an MCP server, redirect a provider URL, or disable approvals.
17
+ This tool reports startup directory and config baseline risks before you start.
18
+
19
+ Python 3.9+; standard library only, no runtime or build dependencies, no network.
20
+ Install with `python3 -m pip install --no-build-isolation .`, or run directly:
21
+
22
+ ```sh
23
+ PYTHONPATH=src python3 -m startup_trust_guard.cli check . --json
24
+ startup-trust-guard check ~/Downloads
25
+ startup-trust-guard config-check
26
+ startup-trust-guard config-check --codex-config ./config.toml --claude-settings ./settings.json
27
+ startup-trust-guard baseline save
28
+ startup-trust-guard baseline save --out ./baseline.json
29
+ startup-trust-guard baseline show
30
+ startup-trust-guard baseline show --path ./baseline.json
31
+ startup-trust-guard trust add ./AGENTS.md
32
+ startup-trust-guard trust list
33
+ ```
34
+
35
+ The scan reads AGENTS.md, CLAUDE.md, GEMINI.md and .cursorrules at the top
36
+ level and directly inside .claude/ and .cursor/, plus .claude/settings.json
37
+ as configuration. It does not recurse further. Git-tracked and explicitly
38
+ trusted files are OK unless suspicious content wins. Downloads paths and
39
+ recent untracked files are HIGH. Older untracked files are conservatively
40
+ HIGH too. Suspicious shell pipelines, provider overrides, approval bypasses,
41
+ destructive commands, credential references and remote MCP definitions are
42
+ CRITICAL. Symlinks are HIGH and are never followed into credential files.
43
+ Content matching is heuristic: quoted examples can trigger findings, and
44
+ obfuscated instructions may evade detection.
45
+
46
+ Config checks read only ~/.codex/config.toml and ~/.claude/settings.json, or
47
+ the explicitly supplied alternatives. MCP entries, provider URL overrides,
48
+ and disabled approvals are HIGH. MCP name and provider URL changes against
49
+ the default baseline are CRITICAL (ADDED, REMOVED or CHANGED). Baselines
50
+ store URL SHA-256 fingerprints instead of raw URLs because URLs can contain
51
+ secrets. `baseline show` displays keys and fingerprint markers, never values.
52
+ Python 3.9/3.10 use a bundled copy of the MIT-licensed CPython standard
53
+ library TOML parser; Python 3.11+ uses tomllib directly. No external TOML
54
+ package is required.
55
+
56
+ Findings contain names, severities and rule names only, never file contents
57
+ or configuration values. Long token-like strings in names are redacted too.
58
+ No credential files are opened. Normal checks are read-only. `trust add`
59
+ explicitly writes the trust registry under ~/.config/startup-trust-guard/;
60
+ `baseline save` explicitly writes its baseline there or at --out.
61
+ Custom baselines can be shown with --path; automatic config comparison uses
62
+ the default baseline. No files are written elsewhere by the tool.
63
+
64
+ Exit codes: **0** means no HIGH/CRITICAL findings (including no config files),
65
+ **1** means findings require review, **2** means a usage, input or I/O error.
66
+ `check --json` returns an object with `dir` and `findings`; `config-check`
67
+ also supports --json. Configuration values are never included in either format.
68
+
69
+ This tool does not block an agent, quarantine or delete files, or auto-fix
70
+ configuration. agent-guard guards tool calls; mcp-audit audits MCP servers.
71
+ startup-trust-guard guards the startup directory and config baseline.
72
+
73
+ Run tests from the project root:
74
+
75
+ ```sh
76
+ python3 -m unittest discover -s tests -v
77
+ ```
@@ -0,0 +1,66 @@
1
+ # startup-trust-guard
2
+
3
+ A website can download AGENTS.md or CLAUDE.md into Downloads, where an agent
4
+ may later treat it as trusted instructions. Agent configuration can also be
5
+ changed to add an MCP server, redirect a provider URL, or disable approvals.
6
+ This tool reports startup directory and config baseline risks before you start.
7
+
8
+ Python 3.9+; standard library only, no runtime or build dependencies, no network.
9
+ Install with `python3 -m pip install --no-build-isolation .`, or run directly:
10
+
11
+ ```sh
12
+ PYTHONPATH=src python3 -m startup_trust_guard.cli check . --json
13
+ startup-trust-guard check ~/Downloads
14
+ startup-trust-guard config-check
15
+ startup-trust-guard config-check --codex-config ./config.toml --claude-settings ./settings.json
16
+ startup-trust-guard baseline save
17
+ startup-trust-guard baseline save --out ./baseline.json
18
+ startup-trust-guard baseline show
19
+ startup-trust-guard baseline show --path ./baseline.json
20
+ startup-trust-guard trust add ./AGENTS.md
21
+ startup-trust-guard trust list
22
+ ```
23
+
24
+ The scan reads AGENTS.md, CLAUDE.md, GEMINI.md and .cursorrules at the top
25
+ level and directly inside .claude/ and .cursor/, plus .claude/settings.json
26
+ as configuration. It does not recurse further. Git-tracked and explicitly
27
+ trusted files are OK unless suspicious content wins. Downloads paths and
28
+ recent untracked files are HIGH. Older untracked files are conservatively
29
+ HIGH too. Suspicious shell pipelines, provider overrides, approval bypasses,
30
+ destructive commands, credential references and remote MCP definitions are
31
+ CRITICAL. Symlinks are HIGH and are never followed into credential files.
32
+ Content matching is heuristic: quoted examples can trigger findings, and
33
+ obfuscated instructions may evade detection.
34
+
35
+ Config checks read only ~/.codex/config.toml and ~/.claude/settings.json, or
36
+ the explicitly supplied alternatives. MCP entries, provider URL overrides,
37
+ and disabled approvals are HIGH. MCP name and provider URL changes against
38
+ the default baseline are CRITICAL (ADDED, REMOVED or CHANGED). Baselines
39
+ store URL SHA-256 fingerprints instead of raw URLs because URLs can contain
40
+ secrets. `baseline show` displays keys and fingerprint markers, never values.
41
+ Python 3.9/3.10 use a bundled copy of the MIT-licensed CPython standard
42
+ library TOML parser; Python 3.11+ uses tomllib directly. No external TOML
43
+ package is required.
44
+
45
+ Findings contain names, severities and rule names only, never file contents
46
+ or configuration values. Long token-like strings in names are redacted too.
47
+ No credential files are opened. Normal checks are read-only. `trust add`
48
+ explicitly writes the trust registry under ~/.config/startup-trust-guard/;
49
+ `baseline save` explicitly writes its baseline there or at --out.
50
+ Custom baselines can be shown with --path; automatic config comparison uses
51
+ the default baseline. No files are written elsewhere by the tool.
52
+
53
+ Exit codes: **0** means no HIGH/CRITICAL findings (including no config files),
54
+ **1** means findings require review, **2** means a usage, input or I/O error.
55
+ `check --json` returns an object with `dir` and `findings`; `config-check`
56
+ also supports --json. Configuration values are never included in either format.
57
+
58
+ This tool does not block an agent, quarantine or delete files, or auto-fix
59
+ configuration. agent-guard guards tool calls; mcp-audit audits MCP servers.
60
+ startup-trust-guard guards the startup directory and config baseline.
61
+
62
+ Run tests from the project root:
63
+
64
+ ```sh
65
+ python3 -m unittest discover -s tests -v
66
+ ```
@@ -0,0 +1,20 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "startup-trust-guard"
7
+ version = "0.1.0"
8
+ description = "Inspect agent startup instructions and configuration trust"
9
+ readme = "README.md"
10
+ requires-python = ">=3.9"
11
+ license = { text = "MIT" }
12
+ authors = [{ name = "hao li" }]
13
+ dependencies = []
14
+
15
+ [project.scripts]
16
+ startup-trust-guard = "startup_trust_guard.cli:main"
17
+
18
+ [tool.setuptools.packages.find]
19
+ where = ["src"]
20
+ include = ["startup_trust_guard*"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,2 @@
1
+ """Startup directory and configuration trust inspection."""
2
+ __version__ = "0.1.0"