A commander's color identity is determined by every mana symbol that appears anywhere in the card's text box, mana cost, and characteristic-defining abilities — this explicitly includes mana symbols in activated ability costs (CR 903.4). So if a card has an activated ability costing {R}, red is part of its color identity even if the card itself has no red in its casting cost.
The full color identity check covers: (1) the mana cost, (2) any mana symbols in the rules text (including costs of activated and triggered abilities), and (3) any color indicators or characteristic-defining abilities (CR 903.4a). Note that reminder text is excluded — mana symbols appearing only inside reminder text do not count (CR 903.4b).
This is important for deck construction: CR 903.5a states that each card in your Commander deck must have a color identity that is a subset of your commander's color identity. If your commander has an activated ability with {G} in its cost, green becomes part of your commander's identity, and you may include green cards in your deck.
Concrete example: Suppose your commander has a casting cost of {2}{W} but has an activated ability costing {B}: Pay 3 life. That ability's {B} makes black part of the commander's color identity. Your color identity is White + Black, so you can include black cards in your deck, but not red, green, or blue ones.
Unofficial fan resource — not affiliated with or endorsed by Wizards of the Coast. Answers are AI-generated estimates grounded in the Comprehensive Rules and are not a substitute for an official judge. Verify anything match-critical.