# superdesigndev/treg — AlpLab Radar Static Code Audit

- Ring: `trial`
- Category: `agents`
- Overall score: `3.4/5`
- Implementation check: `verified`
- Maturity: `early`
- Audited commit: `c051fb25c8fc` (read-only; nothing from the repository was executed)
- Reviewed at: 2026-12-02T10:57:24Z
- Repository: https://github.com/superdesigndev/treg
- Radar entry: https://radar.alplab.co/#repo/superdesigndev/treg
- License: `NOASSERTION`
- CI workflows: `.github/workflows`
- Tags: `tool-registry`, `agent-tools`, `api-proxy`, `credentials`, `mcp`, `fastapi`

## Summary

A Python/FastAPI tool registry that relays catalog and team-owned API calls while injecting server-held credentials, with CLI, MCP, billing, and audit surfaces.

## Implementation Check

README.md's credential-injecting relay claim is implemented by `call_tool` in src/treg/routers/call.py and `relay` in src/treg/infra/upstream/relay.py.

## When to Use

Pilot it for teams centralizing vetted API credentials and agent tool access. Avoid production dependency until its pre-1.0 API, deployment controls, and telemetry posture are approved.

## Sub-scores

| Dimension | Score |
|---|---|
| quality | 4.0/5 |
| usability | 3.5/5 |
| reliability | 3.0/5 |
| security | 2.5/5 |
| integration | 4.0/5 |

## Code Evidence

- src/treg/routers/call.py `call_tool` exposes all major HTTP methods at `/call/{rest:path}` and routes authenticated calls through `run_call_surface`.
- src/treg/infra/upstream/relay.py `relay` strips treg control headers, injects bound credentials, preserves duplicate query pairs, and streams upstream responses.
- src/treg/infra/upstream/ssrf.py `_PinnedBackend.connect_tcp` resolves only public addresses and dials an accepted address to resist DNS rebinding.
- src/treg/localrun.py `validate_cli_profile` rejects shell-like binaries and dangerous injected environment variables.
- src/treg/analytics.py `capture` disables server analytics with an empty PostHog key and documents bounded, lossy event queues.
- .github/workflows/ci.yml runs locked dependency installs, linting, catalog validation, SQLite/Postgres tests, Go tests, frontend tests, and gitleaks.

## Issues Found

- README.md Quickstart distributes the CLI through `curl -fsSL https://treg.to/install.sh | sh`, which executes fetched code without an integrity check.
- src/treg/fsjail.py documents that Linux filesystem-jail wiring is a follow-up, leaving optional local-run write confinement incomplete.
- maturity signals report 28 unpinned GitHub Actions, leaving CI supply-chain updates less controlled.

## Key Risks

- README.md states the project is pre-1.0, so interfaces and operational behavior may change.
- src/treg/cli_analytics.py sends hosted-CLI usage to PostHog by default; users must set `TREG_TELEMETRY=0` or `DO_NOT_TRACK=1` to opt out.
- Self-hosting the server requires FastAPI, database, Redis, encryption, object-storage, and payment extras declared in pyproject.toml.
- LICENSE restricts use as a hosted, managed, or embedded third-party service without written authorization.

## Reviewed Files

- `README.md`
- `pyproject.toml`
- `SECURITY.md`
- `src/treg/api.py`
- `src/treg/bootstrap_http.py`
- `src/treg/fsjail.py`
- `src/treg/routers/call.py`
- `src/treg/analytics.py`
- `src/treg/localrun.py`
- `tests/test_app_entrypoint.py`
- `src/treg/infra/upstream/relay.py`
- `src/treg/infra/upstream/ssrf.py`
- `tests/test_agent_capture.py`
- `LICENSE`
- `src/treg/cli_analytics.py`
