MyData
A service in which individuals manage and use their own data
A service in which individuals manage and use their own data
MyData is a service that allows individuals to exercise control over their own data and to view and manage their information, which is scattered across multiple institutions, in one place. In Korea, the personal credit information management business (MyData) in the financial sector took effect in January 2022, and it is being expanded to other sectors such as healthcare and the public sector through 2024.
The legal basis for MyData is Article 22-9 of the Credit Information Act (right to request transmission of personal credit information), which is similar to the right to data portability under Article 20 of the GDPR. Individuals can have their data held by financial companies, medical institutions, and others transmitted to them in a standardized format and use it in other services.
In relation to AI, MyData has two implications. First, MyData business operators provide personalized AI services (such as personalized financial product recommendations), and this requires transparency and explanation obligations for AI algorithms. Second, because individuals can choose the scope of the data they provide, it can become a new channel for procuring AI training data.
To obtain a MyData business license, authorization for the personal credit information management business from the Financial Services Commission is required, and the applicant must meet requirements such as capital of at least KRW 500 million, an information protection system, and internal control standards. As of 2024, about 60 business operators have obtained authorization and are in operation.
# 마이데이터 API 연동 예제 (금융 분야)
import requests
from datetime import datetime
from dataclasses import dataclass
from typing import List, Dict, Optional
from enum import Enum
class ConsentScope(Enum):
"""마이데이터 동의 범위"""
ACCOUNT_INFO = "account_info" # 계좌 정보
TRANSACTION_HISTORY = "transaction" # 거래 내역
CREDIT_SCORE = "credit_score" # 신용 점수
INSURANCE = "insurance" # 보험 정보
INVESTMENT = "investment" # 투자 정보
@dataclass
class MyDataConsent:
"""마이데이터 전송요구 동의"""
consent_id: str
user_ci: str # 연계정보 (CI)
scopes: List[ConsentScope]
target_org: str # 정보 제공 기관
valid_until: datetime
purpose: str # 이용 목적
class MyDataClient:
"""마이데이터 API 클라이언트 (금융보안원 표준 기반)"""
def __init__(self, client_id: str, client_secret: str,
org_code: str):
self.client_id = client_id
self.client_secret = client_secret
self.org_code = org_code
self.base_url = "https://api.mydata.go.kr"
self.access_token: Optional[str] = None
def authenticate(self, authorization_code: str) -> str:
"""OAuth 2.0 인증 (사용자 동의 후)"""
response = requests.post(
f"{self.base_url}/oauth/2.0/token",
data={
"grant_type": "authorization_code",
"code": authorization_code,
"client_id": self.client_id,
"client_secret": self.client_secret
}
)
self.access_token = response.json()["access_token"]
return self.access_token
def request_data_transfer(self, consent: MyDataConsent) -> Dict:
"""개인신용정보 전송요구 (신용정보법 제22조의9)"""
headers = {
"Authorization": f"Bearer {self.access_token}",
"x-api-tran-id": f"{self.org_code}-{datetime.now().strftime('%Y%m%d%H%M%S')}"
}
payload = {
"user_ci": consent.user_ci,
"org_code": consent.target_org,
"scopes": [s.value for s in consent.scopes],
"valid_period": consent.valid_until.isoformat(),
"purpose": consent.purpose
}
response = requests.post(
f"{self.base_url}/v1/transfer/request",
headers=headers,
json=payload
)
return response.json()
def get_account_list(self, user_ci: str, org_code: str) -> List[Dict]:
"""계좌 목록 조회"""
headers = {"Authorization": f"Bearer {self.access_token}"}
response = requests.get(
f"{self.base_url}/v1/bank/accounts",
headers=headers,
params={"org_code": org_code}
)
return response.json().get("accounts", [])
def get_transactions(self, account_num: str,
from_date: str, to_date: str) -> List[Dict]:
"""거래 내역 조회"""
headers = {"Authorization": f"Bearer {self.access_token}"}
response = requests.get(
f"{self.base_url}/v1/bank/accounts/{account_num}/transactions",
headers=headers,
params={"from_date": from_date, "to_date": to_date}
)
return response.json().get("transactions", [])
def aggregate_financial_data(self, user_ci: str) -> Dict:
"""사용자 금융 데이터 통합 조회 (AI 분석용)"""
# 여러 기관의 데이터 수집
aggregated = {
"user_ci": user_ci,
"collected_at": datetime.now().isoformat(),
"accounts": [],
"transactions": [],
"total_assets": 0
}
# 실제로는 동의받은 모든 기관에서 데이터 수집
banks = ["BANK001", "BANK002"] # 동의받은 기관 코드
for bank in banks:
accounts = self.get_account_list(user_ci, bank)
for account in accounts:
aggregated["accounts"].append(account)
aggregated["total_assets"] += account.get("balance", 0)
return aggregated
# AI 개인화 서비스 예시
def recommend_financial_product(user_data: Dict) -> Dict:
"""마이데이터 기반 AI 금융상품 추천"""
total_assets = user_data.get("total_assets", 0)
transactions = user_data.get("transactions", [])
# 간단한 규칙 기반 추천 (실제로는 ML 모델 사용)
recommendation = {
"user_ci": user_data["user_ci"],
"timestamp": datetime.now().isoformat(),
"products": [],
"explanation": "" # AI Act 투명성 요건: 추천 근거 설명
}
if total_assets > 50000000:
recommendation["products"].append({
"type": "investment",
"name": "고액자산 ETF 포트폴리오",
"reason": "총 자산 5천만원 이상 고객 대상"
})
recommendation["explanation"] = (
f"귀하의 총 자산 {total_assets:,}원과 "
f"최근 거래 패턴을 분석하여 추천되었습니다."
)
return recommendation
# 사용 예시
client = MyDataClient("client_id", "secret", "MYDATA001")
# client.authenticate(auth_code)
# data = client.aggregate_financial_data("user_ci_value")
# recommendation = recommend_financial_product(data)
PM: We're planning an AI recommendation service based on MyData. Are there any regulatory issues?
Legal team: MyData business operators must provide the collected information only to the data subject, and additional consent is required to provide it to third parties or to use it separately for AI training.
ML engineer: Is there also an obligation to explain AI recommendation results?
Legal team: Yes, under Article 36-2 of the Credit Information Act, there is a right to request an explanation of the results of automated evaluation. The basis for the recommendation must be provided in a way that users can understand.
Interviewer: Please explain the differences between MyData and the GDPR right to data portability.
Candidate: Both strengthen individuals' control over their data, but there are differences. The GDPR right to data portability is general-purpose and emphasizes direct transfer between individuals, whereas Korea's MyData is an intermediary model through licensed business operators (personal credit information management businesses). In addition, MyData mandates standard APIs so that actual data transfer is designed to be smooth.
Senior: There's logic that directly uses the information collected through MyData for model training. That could be a problem.
Junior: But the user agreed to use the service, didn't they?
Senior: Consent under MyData is for 'inquiry and analysis,' not for 'AI training.' To use it for model training, separate explicit consent is required. Please handle it separately.
Take a mock interview on this topic → WIA SOOM AI Interview · Start for free