Python: [BREAKING] Python: DevUI improvements#5840
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Tightens DevUI's startup security model so that disabling auth (--no-auth or auth_enabled=False) and relying on auto-generated tokens are restricted to loopback binds; non-loopback hosts now hard-fail unless an explicit DEVUI_AUTH_TOKEN/--auth-token is provided. Validation moves from serve() into DevServer.__init__ so all entry points (CLI, serve(), direct DevServer use) share the invariant. Documentation and CLI help are updated, and focused tests cover the new server, serve(), and CLI paths.
Changes:
- Move loopback/auth validation into
DevServer._resolve_auth_tokenand remove the duplicatedserve()checks; raiseValueErrorfor non-loopback--no-author missing token. - Update CLI help and README/dev/AGENTS docs to reflect loopback-only no-auth and the explicit-token requirement for shared hosts (including
Authorization: Bearerexamples). - Add server,
serve(), and CLI tests for accept/reject paths around loopback vs. non-loopback hosts.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| python/packages/devui/agent_framework_devui/_server.py | Centralizes auth invariant in _resolve_auth_token, host-aware loopback check, error messages |
| python/packages/devui/agent_framework_devui/init.py | Removes now-redundant warnings/validation from serve(); relies on DevServer |
| python/packages/devui/agent_framework_devui/_cli.py | Updates --no-auth and --auth-token help text |
| python/packages/devui/tests/devui/test_server.py | Adds tests for loopback/non-loopback auth validation across DevServer, serve(), and CLI |
| python/packages/devui/README.md | Documents new auth defaults, shared-host guidance, updated CLI options/examples |
| python/packages/devui/dev.md | Adds Bearer token usage notes and --no-auth loopback caveat |
| python/packages/devui/AGENTS.md | Adds short security posture summary |
Contributor
Author
SergeyMenshykh
approved these changes
May 14, 2026
lokitoth
approved these changes
May 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation and Context
Small improvements for DevUI startup behavior.
Description
Updates DevUI startup handling, CLI help, and package guidance so local opt-out behavior stays local and shared-host usage is explicit.
Adds focused coverage for the server,
serve(), and CLI paths.Contribution Checklist