Skip to content

feat(prompt): show profile network rules in first-run prompt#82

Merged
tito merged 1 commit into
mainfrom
mathieu/prompt-show-network-rules
Apr 14, 2026
Merged

feat(prompt): show profile network rules in first-run prompt#82
tito merged 1 commit into
mainfrom
mathieu/prompt-show-network-rules

Conversation

@tito
Copy link
Copy Markdown
Contributor

@tito tito commented Apr 14, 2026

Summary

  • The first-run profile prompt showed filesystem allow/deny lines but silently omitted the profile's network rules, so users approving `greywall -- claude` could not see which hosts were about to be pushed to greyproxy as session-scoped rules.
  • Render `Allow net:` / `Deny net:` lines alongside the filesystem ones, reusing the same green/red coloring. Port is shown only when non-wildcard so the common `host:443` case stays compact.

Before

```
Allow read: ~/CLAUDE.md ...
Allow write: ~/.skills ...
Deny read: ~/.ssh/id_* ...
Deny write: ~/.bashrc ...

[Y] Use profile (recommended) ...
```

After

```
Allow read: ~/CLAUDE.md ...
Allow write: ~/.skills ...
Deny read: ~/.ssh/id_* ...
Deny write: ~/.bashrc ...
Allow net: api.anthropic.com:443 mcp-proxy.anthropic.com:443 downloads.claude.ai:443 platform.claude.com:443 github.com:443 api.github.com:443 *.githubusercontent.com:443 registry.npmjs.org:443 storage.googleapis.com:443

[Y] Use profile (recommended) ...
```

Test plan

  • `go test ./internal/profiles/...` passes with the extended assertions
  • Manual render of the claude profile prompt via a throwaway demo binary
  • Manual: run `greywall -- claude` interactively and verify the Allow net line appears

PromptFirstRun displayed filesystem allow/deny but silently omitted the
network rules, so users approving a profile could not see which hosts
were about to be forwarded to greyproxy as session-scoped rules.

Render allow/deny network rules on their own lines (green/red to match
the filesystem treatment) and render the port only when it is not the
wildcard, so the common "host:443" case stays compact.
@tito tito merged commit 4984233 into main Apr 14, 2026
4 checks passed
@tito tito deleted the mathieu/prompt-show-network-rules branch April 14, 2026 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant