T01 · Skill Instruction Hijacking
- Location
scripts/sentiment.py:20- Finding
Untrusted Yahoo Finance headlines can influence agent instructions
- Content
View full analysis
dict: """Fetch recent news headlines from yfinance for a given ticker.""" try: stock = yf.Ticker(ticker) raw_news = stock.news except Exception as e: return { "ticker": ticker, "headline_count": 0, "headlines": [], "error": f"Failed to fetch news: {e}", } headlines = [] for item in raw_news[:max_headlines]: try: content = item.get("content", item) if isinstance(item, dict) else {} title = ( content.get("title") or content.get("headline") or item.get("title") or "" ) publisher = ( (content.get("provider") or {}).get("displayName") or content.get("publisher") or item.get("publisher") or "" ) canon = content.get("canonicalUrl") or {} click = content.get("clickThroughUrl") or {} link = ( canon.get("url") or click.get("url") or content.get("link") or item.get("link") or "" ) headlines.append({ "title": title, "publisher": publisher, "link": link, "published": published, }) ``` The corresponding Skill instructions require the agent to consume this remote content: ```markdown Returns JSON with: ticker, headline_count, and headlines array (title, publisher, link, published date). **You must read these headlines and provide your own sentiment assessment** ``` ### ...[truncated 1915 chars]- Remediation
View remediation
