Scrivio Interview library
ScenarioIntermediate6 min read · updated 12 November 2026

A colleague proposes shipping DevTools in production images so that a remote restart can be used for quick fixes. How do you respond?

I would say no, and explain why. DevTools is built for development; Spring Boot leaves it out of repackaged jars by default precisely so that it never reaches production. Remote DevTools opens an HTTP endpoint that accepts new class files, which is a serious security risk and lets changes bypass review, testing and the audit trail. The real need behind the proposal is faster fixes, which we meet with a fast CI pipeline, and for changes that are meant to happen at runtime we use feature flags and configuration.

Why this question is asked

Proposals like this usually come from a real pain: a small bug in production takes an hour to fix because the pipeline is slow, and a colleague has found a feature that seems to promise a shortcut. Interviewers ask the question to see whether we can say no to an unsafe idea without dismissing the problem behind it. In this answer, we will recap what remote DevTools does, explain why it is excluded from production by design, look at the security and process risks, and then show what we would offer instead: a fast pipeline and controlled runtime changes.

1A Quick Recap: What Remote DevTools Does

DevTools speeds up local development by restarting the application in a fresh class loader whenever our compiled classes change. Its remote mode extends this across the network. The application runs somewhere else, for example in a container, with DevTools included and a secret configured. On the developer's machine, a client program called RemoteSpringApplication watches the local classpath and, when something changes, uploads the changed class files over HTTP to the remote application, which then restarts with the new code.

To make this work, we have to go out of our way: include DevTools in the packaged jar by turning off the plugin's exclusion, and set spring.devtools.remote.secret. Spring Boot's documentation is explicit that remote support should never be enabled on a production deployment.

XML
<!-- What the proposal requires in pom.xml -->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludeDevtools>false</excludeDevtools> <!-- override the safe default -->
</configuration>
</plugin>
# application.properties
spring.devtools.remote.secret=change-me
# The running app now accepts uploaded class files and restarts with them

2Why DevTools Is Excluded From Production by Design

DevTools changes the application's behaviour in ways that only make sense on a laptop. It turns off template caching, adds detailed error output, runs a file watcher and a LiveReload server, and splits the classpath into two class loaders, which can cause class identity errors that never happen in a normal run. None of this was ever tested in our production configuration.

That is why the Boot Maven and Gradle plugins exclude it from the fat jar by default when it is declared as optional or developmentOnly, and why DevTools disables itself under java -jar unless forced. Shipping it means fighting two safety defaults that exist for this exact situation.

3The Security and Process Risks

The security risk is direct. A remote DevTools endpoint accepts code and runs it. The only protection is a shared secret sent in a header, so anyone who obtains the secret, from a configuration file, a log line, a former employee or a misrouted request, can upload a class that reads the database, steals credentials or opens a shell. The endpoint is effectively remote code execution by design.

The process risk is just as serious. A class uploaded from a laptop skips code review, automated tests, security scanning and the audit trail. Production now runs code that exists in no commit, so the next normal deployment silently removes the fix, or worse, nobody can say what is running. In regulated environments, this alone breaks change-management rules.

So even if we trusted the secret completely, we would still be running untested code that our history does not contain.

Quick fix paths compared
PathReviewed and tested?Traceable?Attack surface
Remote DevTools uploadnono commit, no auditcode upload endpoint
Fast CI pipelineyescommit and deployment recordnone added
Feature flag or config changeflag code reviewed onceflag change loggedflag service only
Only the last two make a fix both quick and safe.

4What We Offer Instead: A Fast Pipeline

The real problem is that a one-line fix takes too long to reach production. We should measure where that time goes and attack it. Often a slow pipeline spends most of its time on things we can change: tests that all run serially, builds without a cache, images rebuilt from scratch, manual approval queues, and deployments that wait for a fixed window.

A realistic target for a small fix is commit to production in 15 to 20 minutes, with the same checks every change gets. Build caching, parallel test execution, layered images so only the application layer changes, a canary deployment that verifies the fix on a small share of traffic, and a documented expedited path for urgent fixes all help. Once that exists, nobody needs a shortcut.

Step throughAn expedited fix that keeps the safeguards
  1. Commit the fix with a testsmall, reviewed by one person
  2. CI: cached build and parallel testsabout 8 minutes
  3. Build a layered imageonly the app layer changes
  4. Canary to 5 percent of trafficwatch errors and latency
  5. Canary healthy?
    YesRoll out to all instancesNoAutomatic rollback

5 steps in order. Play them, or step through them one at a time.

Fast and still reviewed, tested and traceable.

5Runtime Changes That Are Allowed

Some changes really should happen without a deployment: turning a feature off when it misbehaves, changing a timeout during an incident, or raising a log level to diagnose a problem. For these, we design the switches in advance. A feature flag, a condition in the code that reads its value from a flag service or configuration, lets us disable a feature in seconds. The Actuator loggers endpoint, protected and exposed only internally, changes log levels at runtime. Configuration with a controlled refresh, or a rolling restart with new configuration, covers the rest.

The difference from remote DevTools is that the code path was reviewed and tested before it shipped; at runtime we only choose between behaviours that already exist.

Java
// Reviewed and shipped in advance; changed at runtime without a deployment
if (flags.isEnabled("new-pricing", customerId)) {
return newPricing.quote(cart);
}
return legacyPricing.quote(cart);
// During an incident: turn new-pricing off in the flag service -> legacy path in seconds

6Follow-up questions

Is remote DevTools ever acceptable?

It can be acceptable in a personal or team development environment, such as a remote dev container or a test cluster that holds no real data, protected by network rules and used by developers to speed up their inner loop. The rule is that it never runs anywhere with production data, production credentials or external access.

How would you handle the colleague in this conversation?

I would acknowledge the pain first, because a slow fix path is a real problem worth solving. Then I would explain the risks in concrete terms, propose measuring the pipeline together, and offer to own or support the work to speed it up, so the colleague leaves with a better solution rather than just a refusal.

What if a fix must reach production within minutes during an outage?

Then we roll back to the last good version, or switch off the faulty feature with a flag, which both take seconds or minutes. The proper fix follows through the expedited pipeline. Rollback and flags are faster than any hot patch and do not put untested code into production.

7Conclusion

In this answer, we saw that remote DevTools uploads class files to a running application and restarts it, and that Spring Boot keeps DevTools out of production by design. Shipping it opens an endpoint that is effectively remote code execution and lets changes bypass review, tests and the audit trail. We meet the real need with a fast, cached, canary-based pipeline with an expedited path, and handle allowed runtime changes with feature flags, the loggers endpoint and controlled configuration changes.

What to say in the interviewAbout 80 seconds aloud

Open with

I would push back, but I would take the problem seriously. DevTools is a development tool; the Boot plugins even exclude it from the repackaged jar by default, and it switches itself off under java -jar, so we would be overriding two safety defaults.

Then, if they want more

Remote DevTools works by accepting uploaded class files over HTTP and restarting with them, protected only by a shared secret. In production that is a remote code execution endpoint, and anyone who gets the secret can run anything with our credentials.

Even without an attacker, a class uploaded from a laptop skips code review, tests and scanning, and it is not in any commit, so we lose track of what is running and the next deployment silently undoes it.

The real issue is that fixes take too long, so I would suggest we measure the pipeline and make it fast: build caches, parallel tests, layered images, a canary step and an expedited path, aiming for about fifteen minutes from commit to production with all the checks.

For changes that should happen at runtime, we use feature flags designed in advance, the Actuator loggers endpoint for log levels, and configuration rolled out properly. During an outage, rollback or a flag is faster than a hot patch anyway.

About this answer

Last updated
12 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Official documentation
Spring Boot reference
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "A colleague proposes shipping DevTools in production images so that a remote restart can...": https://scrivio-interview-library.netlify.app/spring-boot/developer-experience/17cb59369c/