Skip to main content

How HarmonyOS 7 Rethinks Endpoint Security with Agent-Driven Architecture

HarmonyOS 7 shifts from app-centric to intent-centric design, embedding AI agents in both development and runtime. This article explores how that impacts endpoint security, from fraud detection to code safety.

The Shift from Apps to Intent

When HarmonyOS 7 debuted at HDC 2026, most coverage focused on speed bumps and feature lists. But ask a developer like Liu Guangzhi, a senior full-stack engineer and HarmonyOS advocate, and he'll tell you the real story is architectural. The operating system is no longer just a place to install and launch apps. It's becoming something that understands what you're trying to do—and then figures out which capabilities to call on.

For endpoint security, this shift is a double-edged sword. On one hand, the system can now detect and block threats with unprecedented context. On the other, the attack surface grows as agents talk to each other and to external services. Understanding how HarmonyOS 7 works under the hood is essential for anyone responsible for securing devices running it.

The Six-Layer Architecture and Where Security Fits

HarmonyOS 7's agent framework, HMAF 2.0, is organized into six layers. At the top sits Xiaoyi, the system-level assistant that takes user requests. Below it, HMAF handles task decomposition and orchestrates communication between multiple agents. Then comes the AI foundation—openPangu 2.0 and a 30B on-device model. The fourth layer is where security lives: the Ark engine, Star Shield security, and StarLink connectivity. Developer tools like DevEco Code and CLI sit on top, with specific scenarios like spatial computing at the base.

What's notable for security teams is that Star Shield isn't just a marketing name. It uses on-device AI to detect fraud in real time, classifying seven major scam patterns in seconds. According to Liu, it's already intercepted 3.47 million potential scams, and mainstream apps like Alipay and Douyin have integrated it. That's a concrete, measurable impact on endpoint protection.

Code That Exposes Itself to the System

From a developer's perspective, the biggest change is that apps can now register themselves as agents. They declare capabilities, parameters, and callbacks so the system can invoke them. Here's a simplified example of how a marathon registration feature would plug into HMAF:

import { agentService } from '@kit.AgentKit';
@agentService.AgentExtension
export default class MarathonAgent extends agentService.AgentExtension {
declareCapabilities(): agentService.Capability[] {
return [{
id: 'sign_up.marathon',
description: 'Sign up for a marathon',
inputSchema: {
type: 'object',
properties: {
race: { type: 'string', description: 'Race name' },
date: { type: 'string', description: 'Race date' },
location: { type: 'string', description: 'City' }
},
required: ['race', 'date']
}
}];
}
async onInvoke(task: agentService.TaskInfo): Promise<agentService.TaskResult> {
const { race, date } = task.arguments;
// Call other skills like calendar or payment
const schedule = await this.invokeSkill('calendar.add_reminder', { race, date });
return { status: 'success', result: schedule };
}
}

This is a different beast from "voice assistant calls an API." It's not a one-shot question-answer. The system matches intent via declareCapabilities, then dispatches structured tasks via onInvoke. Multiple agents collaborate behind the scenes.

Development Tools: Two Tracks, One Security Concern

Huawei's developer tooling follows what Liu calls a "dual-track" approach. DevEco Code is the AI-powered IDE extension that can plan, write, compile, debug, and fix code on its own. DevEco CLI, meanwhile, exposes HarmonyOS's atomic capabilities as commands so any external agent—Claude, Cursor, or your own—can call them.

For security, this matters because the tools themselves can introduce vulnerabilities. If an AI generates code with insecure patterns, that code ends up on endpoints. Liu points out that ArkTS (HarmonyOS's TypeScript-based language) has far less training data than Swift or Kotlin. As a result, AI-generated ArkTS code needs manual correction 15–20% of the time. That's a lot of room for subtle security bugs.

There's also a practical gap: DevEco Code doesn't support Linux, and it's tightly coupled to DevEco Studio. That limits its use in server-side and CI/CD environments, where security scanning often happens. Until that changes, teams need to bake extra checks into their pipelines.

Performance vs. Security: A Balancing Act

HarmonyOS 7 introduces a "performance model" in its scheduler. App startup times improve by 24% for system apps and 34% for third-party apps. Game frame rate stability jumps 40%. Annual load growth stays under 10%, below industry average. Those numbers are impressive, but they come with a caveat.

Every optimization that reduces overhead can also reduce the resources available for security monitoring. On-device AI for fraud detection consumes CPU and memory. The Star Shield architecture uses on-device AI to spot scams, but that's running on the same hardware that's trying to deliver smooth performance. It's a constant trade-off, and HarmonyOS 7 seems to be managing it well so far—but it's worth watching how older, lower-end devices cope.

Cross-Device Security: The Soft Bus Advantage

One area where HarmonyOS differentiates itself is cross-device connectivity. The distributed soft bus is baked into the OS, enabling near-instant device discovery and data sharing across brands. That's a huge security plus because it's consistent and controlled by the OS, not left to each vendor's fragmented implementation.

On Android, cross-brand collaboration means stitching together different protocols like Wear OS, Android Auto, and Matter. On iOS, Continuity is smooth but locked inside Apple's ecosystem. HarmonyOS's approach is system-level, and it shows in code:

import { distributedData } from '@kit.ArkData';
await distributedData.applyDeviceProperty('deviceId', {
type: 'video',
uri: 'datashare://video/live',
positionMs,
});

This kind of seamless handoff is powerful, but it also expands the attack surface. If a device is compromised, can it spread malware to others via the soft bus? Huawei's Star Shield includes security measures, but the risk is real. Endpoint security teams need to consider device-to-device trust models when deploying HarmonyOS devices.

Real-World Impact: Kuaishou's Agent Loop

Kuaishou, the Chinese video app, is cited as a real production case. With HarmonyOS's AI tools, they achieved 80% AI code generation, 84% direct adoption of AI test cases, and 73% adoption of AI repair suggestions. Team efficiency improved 1.7x, and two engineers could deliver phone, tablet, and car systems simultaneously.

But the real insight is their "Agent Loop double-loop" approach. They built a specialized Skill called Ark Refiner-Sendable to automate concurrency safety refactoring. The Skill identifies data races, fixes them, and verifies the changes—all automatically. What used to take two people a week now takes half a day, and cold start performance improved 16%.

For endpoint security, this is a model to emulate. Instead of generic AI code generation, targeted Skills that address specific security patterns (like concurrency bugs) can be far more effective. They're also reusable across teams, which lowers the bar for small shops.

The Bottom Line: Agents Are the New Attack Surface

HarmonyOS 7 is a bet that the future of operating systems is agent-centric. That means endpoint security can't just look at apps in isolation. It has to consider how agents interact, what data they share, and how the system's intent-matching logic could be manipulated.

Huawei's approach—integrating development and runtime agents into one framework—is ambitious. It also creates a unique opportunity to bake security into the entire lifecycle, from code generation to runtime orchestration. But it's not without risks. The lack of ArkTS training data, the Linux gap, and the complexity of cross-device trust are all challenges that need addressing.

For now, the message for developers is clear: embrace the agent model, but don't forget to secure it. Use the existing Skills, contribute to community knowledge packs, and test on multiple device form factors. The tools are evolving fast, and so are the threats.

Share this article:

Comments (0)

No comments yet. Be the first to comment!