Skip to content

feat(vscode): add profile config foundation (1 of 5)#250

Merged
veeso merged 2 commits into
mainfrom
feat/fir-405-vscode-profile-config
Jul 10, 2026
Merged

feat(vscode): add profile config foundation (1 of 5)#250
veeso merged 2 commits into
mainfrom
feat/fir-405-vscode-profile-config

Conversation

@veeso

@veeso veeso commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Thinking Path

  • OpenFirma is a runtime enforcement boundary. Every outbound agent call passes through a local Sidecar that evaluates policy and either allows or denies it.
  • This change starts in the config and run-profile layer, where users choose the agent profile that shapes runtime defaults.
  • VS Code needs a named profile before later branches can add the launch and network behavior around it.
  • The config command also needs a VS Code mapping choice so users can scaffold a usable local profile.
  • This pull request adds the profile, config parsing, config scaffolding, and managed seccomp baseline needed by later VS Code work.
  • The benefit is that reviewers can merge the profile foundation before reviewing the runtime and network integration.

What Changed

  • Added vscode and code profile recognition in firma-config-loader.
  • Added a VS Code built-in run profile with proxy sidecar defaults and desktop environment passthrough.
  • Added the VS Code mapping template and config prompt wiring.
  • Added the VS Code managed seccomp policy used by the bwrap backend.
  • Kept the implicit run config tests isolated from ambient FIRMA_CONFIG.

Verification

just check
  • Passed on this branch.
  • The final stacked branch was also compared against the original large PR branch and had an empty diff.

Security Considerations

  • This does not add a network call on the hot path.
  • Fail-closed behavior is preserved. Invalid config still returns an error instead of silently allowing traffic.
  • This introduces a new profile and mapping choice, but does not change token verification, revocation, or Cedar evaluation.
  • The VS Code seccomp baseline is explicit and covered by tests.

Risks

  • Low to medium risk. This introduces a new profile name and default mapping choice, but later PRs contain the runtime behavior that makes the profile useful end to end.
  • Docs for the full VS Code workflow are intentionally in a later PR in this stack, because the user-facing workflow is not complete in this first slice.

Model Used

  • OpenAI GPT-5 Codex. Codex CLI with shell tool use.

Checklist

  • Thinking path traces from project context down to this specific change
  • just check passes locally (fmt + toml-fmt + lint + test + build + audit + deny)
  • No .unwrap(), .expect(), panic!(), or unsafe introduced outside of test code
  • All error paths are fail-closed. Errors produce DENY, not silent ALLOW
  • No network calls added on the hot path involving the normalizer, Stage 1, and Stage 2
  • Tests added or updated for the changed behaviour
  • If this touches the normalizer or action-class registry, mapping table tests are updated
  • If this changes wire format, config schema, or CLI behaviour, docs are updated under docs/ and docs-site/
  • Security considerations are documented above (or "None apply" is stated explicitly)
  • Model used is specified with version and capability details
  • I will address all reviewer comments before requesting merge

Chunks

This is part 1 of 5:

#250 #251 #252 #253 #254

@veeso veeso mentioned this pull request Jul 9, 2026
11 tasks
@veeso
veeso force-pushed the feat/fir-405-vscode-profile-config branch from 993c16a to bae76bd Compare July 9, 2026 15:05
@veeso
veeso requested a review from a team July 9, 2026 15:05
@veeso veeso changed the title feat(vscode): add profile config foundation feat(vscode): add profile config foundation (1 of 5) Jul 9, 2026
@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Comment thread crates/firma-run/src/profile.rs
Comment thread crates/firma/src/args/config.rs Outdated
Comment thread crates/firma/src/services/config.rs Outdated
Comment thread crates/firma/src/services/config.rs Outdated
@LukeMathWalker

Copy link
Copy Markdown
Contributor

Doing a pass focused on alias resolution via Codex seems to suggest we're not normalizing code to vscode in all places:

1. firma run --profile code ... plus config overrides under [run.profiles.vscode]
- Built-in VS Code defaults load.
- User overrides in [run.profiles.vscode] do not.
- Reason: config lookup uses raw "code".
2. firma.toml with [run] profile = "code" plus overrides under [run.profiles.vscode]
- Same failure.
- The selected profile comes back as raw "code", so lookup still misses [run.profiles.vscode].
3. Mixed alias/canonical configs
- If one machine/user uses code and another uses vscode, they can end up needing different sections:
- [run.profiles.code]
- [run.profiles.vscode]
- Only one is read, depending on the raw selected string.

It might be the case that we are not using AgentProfile consistently in all entrypoints.

@veeso
veeso force-pushed the feat/fir-405-vscode-profile-config branch 2 times, most recently from 5ccfbd7 to 960b437 Compare July 10, 2026 08:21
@veeso
veeso requested a review from LukeMathWalker July 10, 2026 08:21
@veeso
veeso force-pushed the feat/fir-405-vscode-profile-config branch from 960b437 to 673badd Compare July 10, 2026 08:35
monitor_mode: false,
}
}

@LukeMathWalker LukeMathWalker Jul 10, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add another test here that checks what happens when using the alias in the profile field.

[run]
profile = "code"

[run.profiles.vscode]
env_passthrough = ["FIRMA_ALIAS_CANARY"]

@LukeMathWalker LukeMathWalker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to merge once the new test is added.

@veeso
veeso merged commit 8a587d0 into main Jul 10, 2026
15 checks passed
@veeso
veeso deleted the feat/fir-405-vscode-profile-config branch July 10, 2026 10:06
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.

2 participants