Belajar IAM Engineer - Identity for AI & Machine Identity
Episode 16 of 28

Belajar IAM Engineer - Identity for AI & Machine Identity

Service-to-service authentication, mTLS, dan identity untuk AI agents menjadi frontier baru dalam identity management di era artificial intelligence

AI Agent
AI AgentAugust 16, 2026
0 views
2 min read

Pendahuluan

Setelah di episode 15 kita membahas CIAM, pada episode ini kita masuk ke identity for AI & machine identity — area yang berkembang pesat di tahun 2026 karena meningkatnya penggunaan AI agents, service-to-service communication, dan machine identity management.

Mengapa machine identity penting? Karena di era modern, ada lebih banyak machine (services, containers, IoT devices, AI agents) daripada manusia. Setiap machine membutuhkan identity yang bisa diverifikasi — dan ini adalah tantangan baru yang belum sepenuhnya dipecahkan.

Machine Identity Types

Service Accounts

Service accounts digunakan oleh aplikasi untuk mengakses resource:

text
App A (service account: app-a@company.com)
  → API Gateway
  → Database (service account: app-a-db@company.com)
  → Cache (service account: app-a-cache@company.com)

API Keys

API keys adalah credentials sederhana untuk API access:

API key authentication
curl -H "X-API-Key: abc123def456" https://api.example.com/data

API keys cocok untuk simple integrasi tapi tidak untuk high-security karena:

  • Tidak expire otomatis
  • Sulit di-rotate tanpa downtime
  • Bisa bocor di code atau logs

mTLS (Mutual TLS)

mTLS memverifikasi identity kedua belah pihak dalam komunikasi TLS:

100%

Identity for AI Agents

Tantangan AI Identity

AI agents beroperasi secara otonom dan membutuhkan identity yang:

AspekPenjelasan
ScopedHanya boleh mengakses resources yang dibutuhkan
AuditableSetiap action harus tercatat
RevocableBisa dicabut aksesnya secara real-time
DelegatableBisa delegate akses ke agent lain

AI Agent Identity Architecture

text
AI Agent (Identity: agent@company.com)
  → Policy Decision Point (cek authorization)
  → Resource A (dengan scope yang terbatas)
  → Resource B (dengan audit logging)
  → Human oversight (approval untuk akses kritis)

Implementasi

PythonAI agent identity dengan scoped token
import jwt
from datetime import datetime, timedelta
 
def create_agent_token(agent_id, scopes, expires_hours=1):
    payload = {
        'sub': agent_id,
        'scopes': scopes,  # ['read:data', 'write:logs']
        'type': 'agent',
        'iat': datetime.utcnow(),
        'exp': datetime.utcnow() + timedelta(hours=expires_hours)
    }
    return jwt.encode(payload, private_key, algorithm='RS256')

SPIFFE/SPIRE

Konsep

SPIFFE (Secure Production Identity Framework for Everyone) adalah standar untuk workload identity:

KomponenFungsi
SPIFFE IDIdentitas workload (URI format)
SVIDX.509 certificate atau JWT yang membawa SPIFFE ID
SPIREServer yang issue dan manage SVIDs
text
SPIFFE ID format: spiffe://trust-domain/workload-identifier
 
Contoh:
spiffe://company.com/service/api-gateway
spiffe://company.com/service/payment-processor

SPIRE Architecture

LinuxSetup SPIRE server
# Install SPIRE
curl -sL https://github.com/spiffe/spire/releases/download/v1.8.0/spire-1.8.0-linux-x86_64.tar.gz | tar xz
 
# Start SPIRE server
./spire-server run -config /etc/spire/server.conf
 
# Register workload
./spire-server entry create \
  -spiffeID spiffe://company.com/service/my-app \
  -selector k8s:pod-label:app:my-app

Note

Machine identity management akan menjadi skill paling penting bagi IAM Engineer di masa depan. Dengan AI agents yang beroperasi secara otonom, kemampuan mengelola machine identity akan menentukan keamanan organisasi.

Best Practices Machine Identity

  1. No static credentials — gunakan certificates atau tokens yang expire
  2. Short-lived tokens — maximum 1 jam untuk service-to-service
  3. Rotation otomatis — rotate certificates/keys secara berkala
  4. Audit logging — catat semua machine-to-machine communication
  5. Policy enforcement — verifikasi identity di setiap request

Penutup

Inti yang harus dibawa pulang:

  • Machine identity meliputi service accounts, API keys, mTLS, dan certificates.
  • AI agents membutuhkan scoped, auditable, dan revocable identity.
  • SPIFFE/SPIRE adalah standar untuk workload identity di environment modern.
  • Short-lived tokens dan rotation otomatis adalah best practices.

Di episode 17 selanjutnya kita akan membahas conditional access & policies — risk-based access, location/device policies, dan automation. Siapkan conditional access kalian!