skip to content

Across several front-end applications, how would you decide which configuration values may be marked public, and make that decision hold?

level: principalimportance: should knowfreq 45%

answer

  1. the toolchain enforces a human's classification
  2. possession test, not obscurity
  3. three tiers, default closed
  4. scan the artifact, not just the source
  5. remove the pressure behind the rename

basics

~20 s

Classify by what possession of the value grants, not by convenience: credentials never public, environment-varying values delivered at render, only build-invariant identifiers inlined. Then enforce it in the pipeline, because a naming rule obeys whoever types the name.

solid answer

~50 s

The toolchain enforces a classification a human wrote into a name, so the policy question is who decides and how the decision survives a deadline. I would define three tiers — **server-only**, **delivered at render**, **inlined at build** — with a default-closed rule and one written test for the top tier: if holding the string is enough to act on a system, it is server-only. Then move enforcement off review and into the pipeline: fail the build when a public-marked name matches credential-shaped patterns, and scan the emitted client output for the values of names classified private. Pair that with making the *tempting* mistake hard — a client read of a private name should fail the build with a message that points at moving the call to the server. Finally, publish each application's exposed keys so a reviewer sees the blast radius in one screen.

go deeper

for a junior

Take away the decision rule you can apply today: if holding the value is enough to act on a system, it never gets the public marker, no matter how inconvenient that is.

for a middle

Explain why a naming convention is a policy instrument, not a security control — it enforces whatever classification a human typed, and nothing in the build second-guesses it.

for a senior

Demonstrate enforcement in the pipeline: pattern checks on public names, a scan of the emitted output for private values, and validation that required public values are present.

for a principal

Show the organisational design — tiers with a mechanical test, a published exposure list per application, central ownership of the credential tier, and a paved server-side path that removes the incentive to publish.

## What you are actually governing The mechanism is simple and unforgiving: a naming convention decides what gets copied into downloadable files, and it obeys whoever types the name. There is no authority in the toolchain that knows a signing key from a base URL. So the thing to govern is not the mechanism but the **classification decision** — who makes it, how it is recorded, and what happens when someone under pressure makes it differently at 6 p.m. Across several applications the difficulty compounds. Each team has its own environment file, its own pipeline, and its own idea of what is sensitive, while the failure is uniform: one wrong name publishes a value permanently. ## A three-tier classification | Tier | Test | Delivery | Examples | |---|---|---|---| | **Server-only** | Possession of the string grants access to something | Never leaves the server; requests needing it are made server-side | Upstream credentials, signing keys, database URLs | | **Delivered at render** | Not a credential, but differs per environment or must change without a build | Read privately on the server, embedded as an enumerated subset | Base URLs, tenant identifiers, flag states, telemetry destinations | | **Inlined at build** | Identical in every environment and safe to freeze until the next build | Substituted into the bundle by the public naming rule | Public product identifiers, build stamps, release-scoped flags | Default-closed: an unclassified value is server-only until someone argues it down, and the argument is recorded in the diff that reclassifies it. ## The tier that needs the sharpest line The boundary that matters is the first one, and the test has to be mechanical because judgement varies under deadline: **if holding the string is sufficient to act, it is server-only** — regardless of how obscure the caller is, how short-lived the value is, or how private the network is said to be. Obscurity, minification and "only our admin screen uses it" are not part of the test. The adjacent case deserves an explicit answer too, because teams argue about it endlessly: vendor keys that the issuer expects to be visible. They belong in the public tiers, and their protection is a **restriction at the issuer** — allowed origins, scope, quota, referrer rules. Write that down so the discussion happens once, and require the restriction to be configured before the key is exposed. ## Enforcement that does not depend on vigilance 1. **Pattern check on names.** Fail the build when a publicly marked name contains credential-shaped words, or when its value matches a known credential format. Cheap, noisy in a useful way, and it fires on the exact diff that causes the incident. 2. **Scan the artifact, not the source.** After the build, search emitted client files for the values of names classified private. This is the only check that catches a private value reaching the client by a route other than the naming rule. 3. **Publish the exposed set.** Each application emits the list of public keys it ships. A reviewer sees the blast radius in one screen, and a diff to that list is a visible event rather than a buried rename. 4. **Validate required public names at build end.** A missing value inlines as empty and fails silently in production; asserting presence turns that into a pipeline failure. ## Removing the pressure that causes the mistake Almost every wrongly published value starts as a broken client read: code in the browser wanted a private value, got nothing, and the one-line fix was to rename it. Policy that only punishes the rename loses to the deadline. The durable moves are to make the failing read **fail at build time with an explanatory message**, and to make the correct alternative — have the server make the call and return only the result — the paved path, with a template every application already has. ## Where to stay flexible - **Do not over-privatise.** Routing every value through render-time delivery grows the payload on every response and buys nothing for values that are identical everywhere. - **Let team ownership stand at tier two and three**, but keep tier one central: the cost of a wrong call there is not local. - **Re-examine tier three periodically.** Values inlined because they were identical everywhere are the ones that quietly stop being identical, and nothing in the build notices. ## What good looks like a year later The list of publicly exposed keys per application is short, reviewed, and shrinking. The pipeline, not a reviewer, is what catches a rename. Nobody argues about vendor keys because the rule was written once. And when a value is wrongly exposed, the response is rehearsed: replace it at the issuer, check its usage, then ask why client code wanted it.

  • Why is a scan of the built output stronger than a review rule on environment files?
    Because it checks what actually ships. A review rule sees names in source and depends on a human noticing a one-line rename; the scan catches that case plus every other route a private value can take into client-bound files, including one copied there by server code. It also runs on the artifact you promote, so it cannot be bypassed by a local build.
  • A team argues their vendor key must stay server-side even though the vendor documents it as browser-visible. How do you resolve it?
    Decide by what the issuer allows. If the key is constrained by origin, scope and quota, exposing it is the vendor's intended model and proxying it through your server adds latency and an endpoint to secure for no gain. Require the restrictions to be configured first. If they cannot be, the key fails the possession test and stays server-side.
  • What is the cost of defaulting every value to render-time delivery instead of inlining?
    Configuration then rides in every response that needs it, and values known only at runtime cannot be folded out of the bundle, so both branches of a flag ship. For values genuinely identical across environments that is pure overhead. Default closed on secrecy, but let build-invariant identifiers inline.
  • How do you keep the classification from rotting as applications multiply?
    Make the exposed set a published artifact per application and diff it in review, so a change is an event rather than a rename buried in an environment file. Re-examine the inlined tier on a schedule, since values that were identical across environments are exactly the ones that drift. Keep the credential tier centrally owned.

saying these in an interview costs you the question

  • Classifies by convenience rather than by what possession grants
  • Relies on code review alone to catch a one-line rename
  • Treats obscurity or minification as part of the decision
  • Routes every value through render-time delivery regardless of cost
  • Never revisits values inlined when environments were identical
  • Punishes the rename without fixing the broken read that caused it