Building a Safer Arabic Voice Assistant for My Home Game Server

Flagship Developer Lab

Building a Safer Arabic Voice Assistant for My Home Game Server

A practical experiment in combining an Android voice interface, a private network, SSH, local speech recognition, and an AI coding assistant—without treating every spoken sentence as permission to change a server.

Last updated: 2 September 2026

The problem I wanted to solve

I run a small home development server used while building and testing browser-game projects such as Color Crash 3D and Metro Rush. A terminal is precise, but it is not always convenient on a phone. I wanted to ask for a status check or describe a maintenance task in Arabic or English and hear a useful response.

The obvious shortcut—transcribing speech and sending it directly to a shell—was also the wrong design. Speech recognition can misunderstand a word, an AI can misunderstand intent, and an administrative command can have consequences that are difficult to reverse. Convenience needed a clear trust boundary.

The safety rule: speaking is not execution

The central rule is simple: a normal voice request produces an explanation or plan first. It does not automatically authorize changes. A separate, explicit confirmation is required before the assistant is allowed to enter its execution mode.

This creates two visibly different stages:

  1. Plan: transcribe the request, ask the AI assistant for a concise spoken response, and leave the system unchanged.
  2. Confirm and execute: only a recognized confirmation immediately following that plan can request the approved action.

This is a useful guardrail, not a security proof. Confirmation words can still be misheard, software can contain defects, and any AI tool with access to files or commands must be treated carefully. High-risk administration still deserves direct human review, backups, least privilege, and a recoverable deployment process.

How the prototype is structured

Android voice interface → private encrypted network → SSH connection → plan/confirmation controller → AI coding assistant → bounded spoken reply

The prototype is divided into two parts:

  • Android client: provides an SSH terminal, Arabic/English speech input, spoken responses, wake-phrase handling, a foreground-service experiment, and strict host-key checking.
  • Server-side voice controller: shares the plan/confirm workflow between phone requests and a local push-to-talk interface. It keeps the conversation state needed to understand that a confirmation refers to the immediately preceding plan.

The connection uses a private network rather than exposing the server's administrative interface directly to the public internet. SSH uses a dedicated key and verifies the server identity. No private address, host name, account name, credential, fingerprint, or key is included in this article.

Arabic and English speech

For the local computer interface, speech-to-text runs with faster-whisper. It can detect Arabic or English and performs transcription locally after the model has been downloaded. On the Android side, the user can choose Arabic or English speech recognition, and that preference also controls the spoken response language.

English replies use a Kokoro neural voice in the local prototype. Arabic currently falls back to espeak-ng. That fallback is functional but noticeably more robotic. A natural, well-tested Arabic text-to-speech engine remains one of the most valuable future improvements.

The assistant sends only the transcribed text needed for the AI turn to the configured AI coding tool. Audio transcription itself is local in the computer version. This distinction should remain visible because “voice runs locally” does not mean every part of the assistant is offline.

What has actually been tested

The following results come from the project's build and test records rather than from a proposed architecture:

  • A dedicated SSH key was verified against the development server without replacing the existing key.
  • Strict host-key verification was implemented, including a clear mismatch path instead of silently trusting an unknown host.
  • Android unit tests and debug APK builds completed successfully across multiple iterations.
  • Arabic and English voice selection, wake-phrase parsing, and confirmation-flow cases received automated tests.
  • The server-side controller was tested to confirm that a planning request left a test file unchanged and that a subsequent explicit confirmation performed the prepared test action.
  • The Android build was installed on a physical phone. With the app in the foreground, a voice request reached the assistant and produced a response in roughly five to six seconds during the observed test.

One important limitation remains unresolved: reliable listening while the phone is in the background or the screen is off. During physical-device testing, the foreground flow worked, but background behavior appeared vulnerable to Android and device-manufacturer battery restrictions. The project therefore does not claim dependable always-listening operation.

A bug that justified the state-machine approach

An early Android build correctly returned the plan but then ignored a bare spoken confirmation. The voice service had reset its “waiting for a command” state before sending the request and did not restore that state after speaking the reply. The next utterance was treated as background audio that needed a new wake phrase.

The fix was small—return to the command-waiting state after parsing the reply—but the lesson was larger. Voice assistants are state machines. Wake detection, transcription, planning, confirmation, execution, speech, timeouts, and cancellation must have explicit transitions. A natural conversation can hide a surprising amount of operational state.

Why this belongs in a game developer lab

The assistant is not part of either game and does not affect gameplay. It is a development-operations experiment around the same environment used to inspect builds, review plans, and maintain test services. That makes it relevant to the process behind the games, while keeping a clear separation between a public game and a private administration tool.

The broader principle also applies directly to game operations: automated tools should be able to inspect and explain freely, but publishing a build, changing production data, or running a destructive command should require a stronger boundary.

What I would improve next

  • Require biometric confirmation for selected high-risk actions instead of relying only on a spoken word.
  • Run the execution component under a restricted operating-system account or disposable container.
  • Replace shared conversation-state storage with isolated, concurrency-safe sessions.
  • Add a compact audit view showing the request, approved plan, executed action, result, and time—without storing secrets.
  • Test background behavior systematically across Android battery modes rather than assuming a foreground service is sufficient.
  • Evaluate a natural Arabic TTS engine with acceptable performance on modest hardware.

Frequently asked questions

Does every voice request run a command?

No. A normal request enters planning mode. Execution requires a separate explicit confirmation after the plan. This reduces accidental changes, although it does not eliminate all risk.

Is the assistant completely offline?

No. The computer prototype transcribes speech locally, but the configured AI coding assistant may use an external service. The Android speech-recognition implementation can also depend on the recognition service available on the phone.

Can it control the server from outside the home?

The design uses a private network and SSH, so remote use is technically possible when both devices are connected correctly. However, this article does not claim that every mobile-network, background, and screen-off scenario has passed end-to-end testing.

Why not expose a web control panel?

A private network and SSH reuse a mature authentication boundary and avoid placing a new administrative panel directly on the public internet. They still require careful key management, server verification, and least-privilege configuration.

Is this project available for download?

No. It is a private experimental tool documented to share the engineering lessons. It should not be treated as a finished product or a security-audited administration system.


ملخص بالعربية

هذه تجربة شخصية لبناء مساعد صوتي عربي وإنجليزي يساعد في إدارة خادم تطوير منزلي يُستخدم أثناء العمل على مشاريع الألعاب. يتصل تطبيق أندرويد بالخادم عبر شبكة خاصة وSSH، بينما يتولى جزء منفصل تحويل الطلب إلى خطة منطوقة.

قاعدة الأمان الأساسية هي أن الكلام لا يعني التنفيذ مباشرة. الطلب العادي يعرض خطة فقط، ثم يحتاج المستخدم إلى تأكيد مستقل قبل السماح بالتنفيذ. تم اختبار بناء تطبيق أندرويد، والتحقق الصارم من هوية الخادم، وبعض حالات الاستيقاظ والتأكيد، كما تم اختبار أن وضع التخطيط لا يغيّر ملف الاختبار وأن التأكيد اللاحق ينفذ الإجراء المحضّر.

تمت تجربة التطبيق على هاتف حقيقي، وعمل الطلب الصوتي عندما كان التطبيق في الواجهة. لكن الاستماع المستمر في الخلفية أو عند إغلاق الشاشة ما زال غير موثوق بسبب قيود البطارية في أندرويد وبعض الأجهزة؛ لذلك لا ندّعي أن النظام جاهز للاستخدام الدائم أو أنه خضع لتدقيق أمني.

Comments

Popular posts from this blog

Color Crash 3D – Free Browser Game

SPACE WAR

Welcome to Flagship Bot Games