Deciding where local Android coding models fit

← Back to Blog & Articles

The unit of work is a request with a data class and a destination.

The durable artifacts are the routing rules, the approved endpoints, and the model records. The main hazard is data leaving through a path the rules did not cover.

Trace a request. The harness builds a context packet and assigns it a class. The routing policy decides local, hosted, or refused. The endpoint guard checks the destination. The result is recorded with the model’s identity. A refusal is returned to the person with the reason.

Capture the baseline with ./gradlew :agentkit:test --tests "*RolloutAndEvaluationTest". Change the routing rule to allow restricted data on a hosted model, see which test fails, and restore it. Then write a model record for the setup you actually use.

Review a routing change for what it newly allows to leave the machine. Ask which data class moves, which destination receives it, and which test now fails or should. Treat an approved host list change as a security change.

When data went where it should not have, find the path first: the harness, a paste, a plugin, an editor extension. Then ask which control covered that path. If none did, the fix is a control or a rule for people, and often both.

Check that secrets are refused whatever the destination, that restricted data never reaches a hosted endpoint, that endpoints are compared by whole host, that tokens are not logged, and that editor extensions are on the approved list.

Test the refusals. Test every data class against every destination. Test hostile endpoints: a lookalike host, a plain HTTP URL, a missing host. Verify local model sizing by measurement on the real machine before committing to it.

Publish the data classes with examples drawn from your own product. Review the approved endpoint list each quarter. Record the model for every evaluation and pilot, and refuse a result that has no record.

  • Data classes are written with examples.
  • Secrets are never sent anywhere.
  • Restricted data stays local.
  • Endpoints are approved by whole host.
  • Every result has a model record.
  • Why is a secret refused even for a local model?
  • What does the endpoint guard compare, and why?
  • Why does the memory estimate give a lower bound?
  • What is wrong with a model name that says “latest”?

Continue with the book

Explore the full treatment, worked examples, and exercises in Agentic Android App Development.


Companion article for Agentic Android App Development, published by Choral Software. Article text and original examples © 2026 Choral Software. All rights reserved.

Scroll to Top