Repository navigation
Document local-only API guardrails #74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| # Local-only API guardrails | ||
|
|
||
| The FastAPI control-plane surface is intended for trusted local development only at this stage. | ||
|
|
||
| The current API does not define authenticated users, remote authorization, tenant isolation, rate limits, network exposure policy, or production secret handling. It must not be treated as a production or remotely exposed service until those boundaries exist. | ||
|
|
||
| ## Current trust boundary | ||
|
|
||
| The API may be used when all of the following are true: | ||
|
|
||
| - it is bound to a local developer environment; | ||
| - the caller is trusted to operate the local workspace; | ||
| - the repository and vault are already available on the same machine; | ||
| - the user understands that mutating approval routes can change local vault files and create Git commits; | ||
| - no public internet listener, shared tunnel, or untrusted LAN exposure is enabled. | ||
|
|
||
| ## Safe local usage expectations | ||
|
|
||
| - Prefer loopback-only binding such as `127.0.0.1` for local experiments. | ||
| - Keep API use scoped to the current repository checkout. | ||
| - Preserve the approval-gated workflow for durable writes. | ||
| - Do not pass API access to chat bridges or external agents without a separate authorization layer. | ||
| - Do not deploy the API behind public ingress until the production checklist below is complete. | ||
|
|
||
| ## Remote exposure checklist | ||
|
|
||
| Before any remote or multi-user deployment, add and test: | ||
|
|
||
| - authenticated caller identity; | ||
| - authorization policy for command, approval, and workspace actions; | ||
| - workspace or tenant isolation rules; | ||
| - request audit records that include caller identity; | ||
| - CSRF/CORS policy appropriate to the client surface; | ||
| - rate limiting or abuse protection; | ||
| - secret and configuration management; | ||
| - explicit network binding and deployment documentation; | ||
| - rollback or transaction protection for failed Git-audit writes. | ||
|
|
||
| ## Route-level implications | ||
|
|
||
| Read-only report and approval inspection routes can disclose project metadata. Mutating approval routes can apply approved patches, move approval artifacts, and create Git commits. Both categories require an authorization boundary before remote use. | ||
|
|
||
| ## Non-goals for this document | ||
|
|
||
| This document does not implement authentication, authorization, production deployment, or network binding code. It records the current safety boundary so future interface work does not accidentally treat the local development API as production-ready. | ||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current
create_app()surface has onlyPOST /commandsand read-only approval list/detail endpoints; it exposes no route that approves a request, applies a patch, moves approval artifacts, or creates a Git commit. In the current API context, this statement therefore misdocuments the available behavior and threat model; either describe the actual/commandsmutations (approval/activity record creation) or defer these implications until approval mutation routes exist.Useful? React with 👍 / 👎.