Skip to content

[Gap]: UI kit inlines its stylesheet, which the default oshp CSP blocks #287

Closed

Description

@jimhoyd

Tried: serve pages built with @jimhoyd/urlcode-ui under policies.security.headers: oshp.
Got: the kit inlines its stylesheet and the stock oshp CSP has no style-src 'unsafe-inline', so the agent had to switch to oshp-no-csp and hand-write a CSP.
Expected: the kit works under the default security profile, or a documented preset/option exists next to the kit docs.
Suggestion: external hashed stylesheet, CSP nonce/hash support, or a named CSP preset for the kit. docs/policies/security.md documents the general inline-style block but not the kit interaction.

Evidence: A/B benchmark on URLCode 0.4.2, Sonnet 5 agent building a blog from the repo docs (n=1; the agent's own report, not independently reproduced). Artifacts: urlcode-benchmarks/blog-2026-09-20/ (local). The agent finished with 25/25 acceptance checks; the control used 58,773 tokens vs 125,443 for URLCode.

Activity

  1. added
    enhancement
    ai-first
    extension
    on Sep 20, 2026
  2. jimhoyd commented on Sep 20, 2026

    @jimhoyd
    CollaboratorAuthor

    Progress: an agent is working on this; a PR will be linked here when it opens.

  3. added
    in-progress
    on Sep 20, 2026
  4. jimhoyd commented on Sep 20, 2026

    @jimhoyd
    CollaboratorAuthor

    Progress: PR #295 opened. renderDocument gets an optional style: {nonce} plus documentContentSecurityPolicy(nonce); oshp is unchanged. The kit's own hashed-stylesheet path already worked; only renderDocument emitted an un-nonced inline style. Not yet checked in a real browser.

  5. added
    important
    and removed
    in-progress
    on Sep 20, 2026
  6. jimhoyd commented on Sep 20, 2026

    @jimhoyd
    CollaboratorAuthor

    Fixed in #295: renderDocument takes an optional style: {nonce}, and documentContentSecurityPolicy(nonce) returns the matching strict CSP, so pages run under the default oshp profile without weakening it. The kit's own hashed-stylesheet path already worked. Whether renderDocument should stop inlining its stylesheet altogether is recorded on the open-decisions list. Not verified in a real browser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ai-firstenhancementextensionimportant

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions